APK release not update installed AAB app from Play Store - android

I have installed previous version of my app from Google Play Store.
Now, I make an apk release with the same keystore file with gradlew assembleRelease command or with android studio, and try to install it manually in device or with gradlew installRelease on emulator.
But every time I got App not installed error.
I got this on LOGCAT:
INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.myapp.myapp signatures do not match previously installed version; ignoring!
I use enableSeparateBuildPerCPUArchitecture in my gradle file.
and also I enable v2 signing with these commands in gradle file (in release section of signingConfigs):
signingConfigs {
debug {
storeFile file(...)
storePassword ...
keyAlias ...
keyPassword ...
}
release {
storeFile file(...)
storePassword ...
keyAlias ...
keyPassword ...
v1SigningEnabled true
v2SigningEnabled true
}
}
NOTE: Also if I install the previous version of my app manually, the Play Store won't update it.

This is the expected behaviour.
This is because the keystore signatures don't match, as most likely you have opted in for your signing key to be managed by Google. You will have to uninstall the previous app before installing the new version if it comes from a different source (Google Play/ Android Studio build).

Related

Is there a way to set a permanent SHA-1 key for android studio project?

I made this Android app that fetches some data using AI Platform Training & Prediction API from Google Cloud Platform. For this app to work it needs to be approved by GCP using SHA-1 Fingerprint certificate. I am making this app as an assessment for module Im taking at the university, so, when the teacher will open my Android Studio project it will have a different SHA-1, so the app will not fetch the data...
Any Ideas how I might be able to maybe set a permanent SHA-1 key for my project, so when the teacher will open the project, Android Studio will not generate a new one?
Thank you!
The SHA-1 is based on the app signature. Since this is for a project I suggest you do the following (never do this in a production app).
Create a new signing key (Build -> Generate Signed Apk -> APK ->
Create New)
Move the signing key to your project's folder
Add this to your app.gradle
android {
signingConfigs {
debug{
storeFile file("your_key.keystore")
storePassword 'password'
keyAlias 'alias'
keyPassword 'password'
}
release {
storeFile file("your_key.keystore")
storePassword 'password'
keyAlias 'alias'
keyPassword 'password'
}
}
}
EDIT: Forgot to mention, run the signingReport gradle task after you do this to get your new SHA-1 that you have to add to your project.
after creating the .keystore file and running the report I get the new SHA-1 key, but the build fails. I get this:
Entry name 'play-services-ads-identifier.properties' collided

Updating existing debug app with different developers

I have trouble with updating the debug version of the app's apk:
Installation failed with message Failed to finalize session : INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package [here our package] signatures do not match the previously installed version; ignoring
Two developers. Two PC's with same Android Studio versions (3.2.1). But when I try to install - have this, when the second developer make a debug apk with the same code (with git) it installs normally.
If I make an apk - it's an error occurred via an update of a version of the second developer on a different device (tester).
What I've tried already:
Restart Android Studio.
Clean and Rebuild.
Invalidate Caches and Restart.
Build apk and installed from the device. ("Application doesn't install" error occurred during update)
Increase versionCode.
The device is a Lenovo TB-X103F tablet on Android 6.0.1.
You need to use the same debug keystore. Your colleagues' keystore will be at:
Windows: C:\Users\USERNAME\.android\debug.keystore
Linux / Mac: ~/.android/debug.keystore
3 solutions are below in descending order of correctness:
In the long term, this should be configured inside your project, so that anyone with the project can sign the debug builds. This is done by configuring your build.gradle like so.
You can also set your signing config inside Android Studio, so you are not reliant on copying his file in the future. Here is how to set it.
You could also just replace your debug keystore in that location with your colleagues, so you are using the same config.
Different keystore files cause this warning. For the exact solution;
-Create your own keystore files for each build types.
-Define buildTypes and SigningConfigs in app level gradle file
like this:
signingConfigs {
release {
keyAlias '******'
keyPassword '******'
storeFile file('...\\release.jks')
storePassword '******'
}
debug {
keyAlias 'alias'
keyPassword '******'
storeFile file('...\\debug.jks')
storePassword '******'
}
}
buildTypes {
release {
lintOptions {
}
debuggable false
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
debug {
debuggable true
minifyEnabled false
signingConfig signingConfigs.debug
}
}
NOTE!!! You can move debug keystore file into project folder(app folder will be a good choice). So both developers have the same keystore easily.

Android sign apk from gradle issue

I used android studio to generate sign APK (build->generate sign APK).
both V1 and V2 checkboxes were marked in the signature version.
To upload an APK via CI-CD, I am running assemleRelease cmd.
The problem is that the sign from assembleRelease is different (probably it's signed with V1 only).
How can I run assembleRelease to sign with the same signature as android studio (build->generate sign APK)?
my code:
android {
signingConfigs {
release {
storeFile file('../config/xx.jks')
Properties props = new Properties()
props.load(new FileInputStream(file("../local.properties")))
storePassword "password"
keyAlias "my-alias"
keyPassword "password"
v2SigningEnabled true
}
debug {
storeFile file("../Config/xx.keystore")
}
}
My mistake, The path from the studio linked to another key-store file (not the one the "storeFile file('../config/xx.jks')" linked to..

android studio error: app-release-unsgined.apk is not signed

I am getting this error while i try to run my project from Android Studio to Genemotion. It was working perfectly fine and then I signed the app to test it on other phones and ever since I am unable to run it from android studio. No idea what to do, I tried messing around with Gradle Tasks but they didn't workout.
I have already seen other posts like these Getting error :app-release-unsigned.apk is not signed but they didn't help
I you don't want to add the to your Gradle file the signing information, you can just change to the debug mode for your current build type:
If you want to add the signing information to your build.gradle just do the following:
signingConfigs {
release {
storeFile file("release.keystore")
storePassword "******"
keyAlias "******"
keyPassword "******"
}
}

Android : "Keystore was tampered with, or password was incorrect" after migrating from Eclipse to Android Studio

I've been developing my project in Eclipse IDE. The app is submitted on Play Store, and I've published a couple of versions updates successfully.
Recently I've migrated to Android Studio (and gradle, of course). I've done some changes to the project code base, including min and target sdk changes, but package name remains the same. The project is successfully compiled and debug app is successfully assembled and running ok.
But now I can not assemble a release version because of :
Keystore was tampered with, or password was incorrect
The keystore have not changed, and I do know it's password.
I've set signingconfigs in build.gradle:
android {
...
signingConfigs {
release {
storeFile file("keystore/motolife.keystore")
storePassword "***"
keyAlias "motolife"
keyPassword "***"
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
...
}
I've tried also to sign using jarsigner:
jarsigner -verbose -keystore keystore/motolife.keystore build/outputs/apk/motolife-new-debug.apk motolife
But no luck.
I've even installed gradle support for Eclipse and tried to assemble signed release app , but got the same "Keystore was tampered with, or password was incorrect" error.
try doing something like this then:
release {
storeFile file("keystoreName.keystore") //change value per signing
def pass = System.console().readPassword("\nPlease enter key password: ")
pass = new String(pass)
storePassword pass
keyAlias "revision3" //need to change these values per signing
keyPassword pass
}

Categories

Resources