3

I just upgraded my Android Studio from 1.5 to 2.2, and now when running my App I get the error:

Installation failed since the APK was either not signed, or signed incorrectly. If this is a Gradle-based project, then make sure the signing configuration is specified in the Gradle build script.

I already googled for it, and nothing worked for me, my gradle file is:

...
android {
    signingConfigs {
        myapp_signed {
            keyAlias 'mkey'
            keyPassword 'pwd'
            storeFile file('.../_keystore.jks')
            storePassword 'pwd'
        }
    }
    compileSdkVersion 22
    buildToolsVersion "21.1.2"
    defaultConfig {
        applicationId '...'
        minSdkVersion 14
        targetSdkVersion 22
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
            signingConfig signingConfigs.myapp_signed
        }
    }
    productFlavors {
    }
}
...

Does anybody know how to solve this? Right before I got this error, I got another error, which was saying:

Warning:Gradle version 2.10 is required. Current version is 2.2. If using the gradle wrapper, try editing the distributionUrl in C:\Users\blahblah\myproject\gradle\wrapper\gradle-wrapper.properties to gradle-2.10-all.zip

which I solved like this "Gradle Version 2.10 is required." Error

EDIT: Even if I switch build variants back to debug, uninstall the app and try it again I get the same error.

Community
  • 1
  • 1
Luca Thiede
  • 3,229
  • 4
  • 21
  • 32

6 Answers6

2

For me the solution was, to update all the libraries I used and update to Android 23. Maybe this helps somebody.

Luca Thiede
  • 3,229
  • 4
  • 21
  • 32
1

By default, Android Studio 2.2 and the Android Plugin for Gradle 2.2 sign your app with Signature Scheme v2. add v2SigningEnabled false to signingConfigs may solve your problem.

signingConfigs {
      release {
        storeFile file("myreleasekey.keystore")
        storePassword "password"
        keyAlias "MyReleaseKey"
        keyPassword "password"
        v2SigningEnabled false
      }
    }

ref. https://developer.android.com/preview/api-overview.html#apk_signature_v2

Qamar
  • 4,959
  • 1
  • 30
  • 49
0

For reference, my signing configs look like this - not my real passwords :

 signingConfigs {
    release {
        storeFile file("keystore/release.jks")
        keyAlias "release"
        storePassword "storepass"
        keyPassword "keypass
    }

    debug {
        storeFile file("keystore/debug.jks")
        keyAlias "androiddebugkey"
        storePassword "android"
        keyPassword "android"
    }
}

 buildTypes {
    release {
        minifyEnabled true
        zipAlignEnabled true
        signingConfig signingConfigs.release
    }

    debug {
        minifyEnabled true
        zipAlignEnabled true
        signingConfig signingConfigs.debug
    }
}
Cory Roy
  • 5,379
  • 2
  • 28
  • 47
0

Did you try to generate a new keystore to use? In my case, my old keystore file is not working anymore after I upgrade from gradle build tools 1.5.0 to 2.1.0 It surprise me when I try it out...

Evan Lin
  • 11
  • 3
  • Yeah, I created a new keysrore, and it is still not working. Also it doesn't even work in the debug mode, where Android Studio uses the default keystore, and if this would be corrupted, my other Apps shouldnt work either should they? – Luca Thiede May 23 '16 at 14:27
0

Apparently the issue is bug us with downgrading gradle to version 2.1.0

    classpath 'com.android.tools.build:gradle:2.1.0'
ribads
  • 393
  • 3
  • 7
0

if you still get this error even in debug mode then just Clean your project and Run again. That worked out for me

P.S: I am using Android 2.2 Beta