2

I created a keystore and used it to succesfully Publish my app. I then added Android Analytics to the app. The app builds OK. But trying to: Generate signed APK, fails with only the one keystore error:

My app build.gradle file:

    apply plugin: 'com.android.application'
    apply plugin: 'com.google.gms.google-services'
    android {
        signingConfigs {
            config {
                keyAlias 'PrimeEscapeGame'
                keyPassword 'sr!#39&RDY'
                storeFile file('I:/keystoresPE/android.jks')
                storePassword 'PE%#@11#Rdy'
            }
        }
        compileSdkVersion 23
        buildToolsVersion "23"
        defaultConfig {
            applicationId "com.mathgames.PrimeEscape"
            minSdkVersion 11
            targetSdkVersion 23
            versionCode 2
            versionName "2.0002"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'),   'proguard-rules.txt'
                signingConfig signingConfigs.config
            }
        }
        productFlavors {
            upgrade {
                applicationId "com.mathgames.PrimeEscape.app.upgrade"
                versionName "2.0002-upgrade"
            }
            free {
                applicationId "com.mathgames.PrimeEscape.app.free"
                versionName "2.0003-free"
            }
        }
    }

    dependencies {
        compile 'com.android.support:support-v4:23.1.0'
        compile 'com.android.support:appcompat-v7:23.1.0'
        compile 'com.google.android.gms:play-services:8.1.0'
        compile 'com.google.android.gms:play-services-analytics:8.1.0'
        compile 'com.google.android.gms:play-services-ads:8.1.0'
        compile 'com.google.android.gms:play-services-identity:8.1.0'
        compile 'com.google.android.gms:play-services-gcm:8.1.0'
    }

The Module settings for signing appears to agree with the above build.gradle file. So far I have tried the following: creating the keystore on a different drive creating a keystore with a different file folder name closing android studio and restarting it restarting the computer make nodule app clean Project rebulild Project

None of the above give errors until I attempt: Generate Signed APK Is there a flag or setting that I am missing or something else I should try?

Randy
  • 21
  • 1

1 Answers1

0

Randy. Look at your build.gradle file and check gradle version. Try to set older version gradle like classpath 'com.android.tools.build:gradle:1.2.3' and then generate signed apk. In my situation this solved my problem.

d0pestar
  • 565
  • 1
  • 5
  • 10
  • This did not work. It appears that the program is not letting me create a new Keystore when we get the error. I tried restoring the program to the original that I used to sign the release version in the Play store, but it gets now gets the same error. Between these two version of the program there was an update to the SDK. Could this be causing the problem? If so, what can I do to create a new keystore that will not throw the error. Thanks – Randy Oct 28 '15 at 17:44