Question

Hi I have a problem with signing android project in Android Studio, we are 3 people working on a project and we want to include the google+ sign in. Since the google+ sign in requires to sign with a selfsigned cerficate (we cannot use the debug.keystore because it's different on each machine), so set the build.gradle like this:

android {
    compileSdkVersion 19
    buildToolsVersion "19.0.3"

    defaultConfig {
        minSdkVersion 10
        targetSdkVersion 19
    }

    signingConfigs {

        release {
            storeFile file("path/to/key.keystore")
            storePassword "password"
            keyAlias "alias"
            keyPassword "password"
        }
    }

    buildTypes {
        release {
            signingConfig signingConfigs.release
        }
    }


}

dependencies {
    compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
    compile 'com.android.support:support-v4:+'
    compile 'com.google.android.gms:play-services:4.3.23'
}

Obviously the login with google+ doesn't work because I checked that the SHA1 of the apk (in workspace/project/app/build/apk/project.apk) is different, what am I doing wrong? Thank you in advance for the help!

Was it helpful?

Solution

You need to select the release build variant for Gradle to use the keystore specified.

To do so, open the "Build Variants" tool window near the lower left corner of Android Studio, then use the dropdown to select "release."

Build Variant button

If you don't see the "Build Variants" button, you should be able to find it under View > Tool Windows.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top