GGWP
GGWP

Reputation: 1121

Change SHA-1 certification debug to release

I implemented Google Authentication but the problem is i entered the debug version key of SHA-1 certificate, now if i'm gonna create a release version of my app obviously Google Authentication won't work anymore. Any Idea?! i don't want to create a new project again because my app is really complex to start again.

Upvotes: 1

Views: 780

Answers (1)

IntelliJ Amiya
IntelliJ Amiya

Reputation: 75788

Read release certificate:

The Android SDK tools generate this certificate when you do a release build. You can also generate this certificate using the keytool program. Use this certificate when you are ready to release your app to the world.

You should create SHA1 KEY for Release Build . Check RELEASE CERTIFICATE TAB in above link .

Finally you should add this build.gradle

buildTypes {

    debug {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        manifestPlaceholders = [mapApiKeyValue: "AIzaSyCcjiArs-4tOeR-9CheiOh8shT9ikh****"]
    }
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        manifestPlaceholders = [mapApiKeyValue: "AIzaSyCWUAJ5eGSWyTX-FTnZJvT6SF1-*******"]
        signingConfig signingConfigs.config
    }
}

Make sure you added like this in Manifest

 <meta-data
        android:name="com.google.android.geo.API_KEY"
        android:value="${mapApiKeyValue}" />

Upvotes: 3

Related Questions