Cannot install newer version on android device - android

While testing my app one of the action I did is to clean install from PlayStore and then install update from my computer. When I did so I received the error INSTALL_FAILED_VERSION_DOWNGRADE, there are a-lot of information in google about this error I understood that I need to increase the versionCode in build grade file, and I did so.
But then I started to receive the following error: INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package ###### signatures do not match previously installed version; ignoring!.
All suggestion that I can find is about uninstall the app from device and then clean install, and it does work. My question is why it happened? I am really concern about the customers who already have this app installed, they wan't be able to to update as well?
Thanks for your answers

This means, that the two APKs are signed with different signing keys.
If you try to install a debug version, the APK is signed with a debug key. So it is normal that the installation will fail.
In order to test the update of your app, either create a release version of your app (e.g. by selecting "release" from the "Build variants" tab. Or add the signing release configurations to your debug build variant in the app module's build.gradle file.

When you upload your app to the Play Store you sign the app with a key. Now when you develop your app further and try to deploy it on your phone the app is either not signed or signed with a development key because it's only a development version of the app.
Therefore I assume you get this signature error because the app's signature just won't match. Once you upload a new version of your app to the Play Store you'll sign the app again with your key which results in the same signature and the Play Store will recognize your app as the same with a newer version.

Related

How to properly update Google Play Services

Is it possible to update my app after changing the Google Play service library in the build.gradle?
I changed it from:
compile 'com.google.android.gms:play-services:8.3.0'
to
compile 'com.google.android.gms:play-services-ads:8.4.0'
After changing the Play Service version, and installing on my phone, android studio gave me a warning saying that I can't update the existing application, and I must uninstall it. So, can I still release the new APK in the developer console, and will it cause issues?
After changing the Play Service version, and installing on my phone,
android studio gave me a warning saying that I can't update the
existing application, and I must uninstall it.
its give you warning because in you device you have signed APK and you are trying to update it using debug apk. so generate signed apk(with same certificate whatever you have used previously) then update app in device.
So, can I still release the new APK in the developer console, and will
it cause issues?
in above process there is no issue then you can upload same signed apk on Google Play Store
assume you know what is signed & debug apk and how to generate both
EDITED:
Gradle is a build system. i am not able to explain it in simple way but you can read more detail of Gradle in this answer and for more about build system and Build System Overview
I suspect that what happened here is that your signing key doesn't match. (I.E. if you downloaded your release-key version from the Play store while using the debug key with Android Studio) Changing Play Services should not have this impact.
You can only update your application to the Play Store if it's signed by the same old key that you used for signing the application first time.
As you probably already know, when you compile application to run on your device for testing, it's signed with the debug key.
If you already have your application installed on your phone that's signed with production key and you try to re-install application that's signed with debug key then it will not work. You will first have to uninstall old application and then reinstall.
To sum it up, you can only release new version if you sign your application with the old production key that you have. In this case, application will be updated on users phone without them uninstall your old application.

Cannot install signed apk to device manually, got error "App not installed"

I'd like to publicate my app to GooglePlay but first i would like to do a last testing with the signed apk to ensure that all of the used API keys are working correctly with the release version (GMaps, Facebook, etc)
So i just made a signed version of my app with our release key and when i try to install the app to the device i got an error:
I have tried to copy the apk to the device and install it with an apk installer app.
Strange thing is when i do the same process with debug signing key, all is well, I can install and run the app.
Here are the steps of the procedure:
I select the release key, type password.
I do select release build type instead of debugging
Just in case i also defined in the gradle file the signing keys but I must admit i dont know is it necessary.
I tried like 7 seven times now so i assume this problem is not just a
mistyped password, also I can make this work with the standard debug android signing key.
Please help if you can.
You may be using the android 5.0 or above device.
May be your development version is not uninstalled properly.
Try this,
Just go to the Settings --> Apps --> Click on your App. ---> In App info page at the action bar menu there will be an option called " Uninstall for All users " click that. Your app will be completely uninstalled and now you can try installing the new version with no issue. Hope this will help you
NOTE : This is for lollipop and above.
Refer the screenshot attached.
For Current Updated Android Studio 2.3 users this answer is for you as hardly people use eclipse nowadays for Android development as Android studio has huge advancements.
So, Follow this way to create your Signed apk file.
Build > Generate Signed apk.
Create Keystore path.
Put Password, alias, key password.
Build type select accordingly(eg to release in playstore use release).
Signature Version select both V1 and V2 checkboxes.
Finsih.
Go to from explorer where you selected for the apk to store and you will see your .apk file name as app-release.apk use it.
selecting Signature Version v1 and v2 both solved the problem for me....try it
The same thing happened to me, as long as I generated my apk from Build> Build APK. I could install and un-install the apk as many times as they were without any problem, but instead if I generated the Build> Generate Signed APK, when I passed the apk to the phone and try to install it, it only allowed me one occasion, the same one that came out the following message:
until then everything was fine if I selected "INSTALL IN ANY WAY", but what happened if I uninstalled the app and wanted to reinstall it (a possible scenario), the following happened:
so I solved the problem by disabling play protect, which I achieved (within Google Play)> Menu> Play Protect> Search for security threats (disable).
"App not installed" shows when an app with same package already installed in same device. just delete your first application which you were using for testing purpose before making it to signed apk. This will work. cheers!
Select both Signature Version v1 and v2 will resolve the issue
v1 scheme
A JAR file can be signed by using the command line jarsigner tool or
directly through the java.security API. Every file entry, including
non-signature related files in the META-INF directory, will be signed
if the JAR file is signed by the jarsigner tool. For every file entry
signed in the signed JAR file, an individual manifest entry is created
for it as long as it does not already exist in the manifest
V2 scheme
v1 signatures do not protect some parts of the APK, such as ZIP
metadata. The APK verifier needs to process lots of untrusted (not yet
verified) data structures and then discard data not covered by the
signatures. This offers a sizeable attack surface. Moreover, the APK
verifier must uncompress all compressed entries, consuming more time
and memory. To address these issues, Android 7.0 introduced APK
Signature Scheme v2
By default, Android Studio 2.2 and the Android Plugin for Gradle 2.2 sign your app using both APK Signature Scheme v2 and the traditional signing scheme, which uses JAR signing.
It is recommended to use APK Signature Scheme v2 but is not mandatory.
please see the details
In Android Studio 3.0 and Above
As described here
Note: The Run button builds an APK with testOnly="true", which means the APK can only be installed via adb (which Android Studio uses). If you want a debuggable APK that people can install without adb, select your debug variant and click Build Bundle(s) / APK(s) > Build APK(s).
Add android:testOnly="false" inside Application tag in AndroidManifest.xml
Reference: https://commonsware.com/blog/2017/10/31/android-studio-3p0-flag-test-only.html
Above shubham soni answer works for me,actually it happens to android version >=5.0.In above you able to install just use this while creating your apk...
Here I resolved this issue
The reason behind this issue is, there is already an application with the same package name in the phone, but you cannot find it in phone menu(U already made the un-installation but actually its still in your phone).
To see the application go to phones SETTINGS -> APPS.
There you can see the application, but inside that the UNINSTALL button may be disabled. click on the menu overflow button to see Uninstall for all users.
After performed uninstalled for all users I have successfully installed my signed apk.
You can also use adb to uninstall the app from phone.
adb uninstall package name
In addition to this,
if your mobile supports multiple users then check if respective app is not installed for other users. If it is installed for others then first uninstall previous app and try again
I faced the same issue today, I remembered that I signed my apk with the "new" Google Play signing:
Make sure if you signed your application with Google Play signing.
If you did:
Upload your apk to Google Console (like you
usually would when updating your application):
After it has successfully uploaded, open the Artifact library in the menu.
You will see the apk you have just uploaded.
Press the download button and select Download derived APK.
You will now be able to install the apk.
You can delete the draft after have downloaded the apk without having to update your application to the Google Play Store
minifyEnabled false
is the only that worked for me after 3 days of research on all forum!
Android Studio 4.1.1
If you want to create the debug apk, and just before creating the apk you tried running on your phone/simulator (doing create signed apk right away will cause the APP NOT INSTALLED),YOU SHOULD CLEAN THE PROJECT before creating signed bundle/apk
It's quite old question, but my solution was to change versionCode (increase) in build.gradle
Go To Build.Gradle(module:app)
use this - minifyEnabled false
That may because you run APK file from external SD card storage.
Just copy APK file into internal storagem problem will be solved
This can happen due to your choice of the signature version. On some phones, installation errors occur if the signature version was selected as V2. So if that happens, try selecting V1, it will surely work.
Removing android:testOnly="true" attribute from the AndroidManifest.xml worked.
link
I am using Android 10 in MiA2. The mistake I was making is that I tried to install the app via ES Explorer. I tried Settings -> Apps & Notifications -> Advanced -> Special App Access -> Install Unknown Apps -> ES File Manage -> Allow from this source. Even then the app won't install.
Then I tired to install the app using the default File Manager and it installed easily.
The checked answer is for rooted devices, or at least it doesn't work for me.
I found a way that you can simply solve the problem by uninstall your apk from adb by using adb uninstall app.package.name (make sure that Debug app is installed on your phone)
then try to install signed apk. Hope this helps you guys.
I was facing the same issue with my android application.
I just updated a library and then created a signed APK. Now it's working.
if Your Android Studio Version Greater than 3.0
Looks like we can not directly use the apk after running on the device from the build -->output->apk folder.
After upgrading to android studio 3.0 you need to go to Build -> Build Apk(s) then copy the apk from build -> output -> apk -> debug
File > Project Structure > Build Variants > Select release > Make sure 'Signing Config' is not empty > if it is select from the drop window the $signingConfigs.release
I did this with Android Studio 3.1.4 and it allowed me to create a release apk after following all the steps above of creating the release apk and release key and adding the info to the app gradle. Cheers!
You don't have to uninstall the Google Play version if App Signing by Google Play is enabled for your app, follow the steps:
1. Make a signed version of your app with your release key
2. Go to Google Play Developer console
3. Create a closed track release (alpha or beta release) with the new signed version of your app
4. You can now download the apk signed by App Signing by Google Play, choose derived APK
Install the downloaded derived APK
The reason is App Signing by Google Play signs release apps with different keys, if you have an app installed from Play Store, and you want to test the new release version app (generated from Android Studio) in your phone, "App not installed" happens since the old version and the new version were signed by two different keys: one with App Signing by Google Play and one with your key.
Kindly uninstall the debug app in the device or just increase the version code to overcome this issues
In my case I was trying to test installing a signed APK and the current installed version on my device was unsigned (building a debug version directly from Android studio)
I tried a lot of things and the following combination worked
Clean, Rebuild
Generating a new key. I used a new key alias that had not been used before. Also, for all the passwords, I used only alphabets and numbers without any spaces or special characters
To uninstall any apk, version etc from the device, I connected my device via usb and ran the command
gradlew uninstallAll
The signed release and debug apk worked
(Note: The debug and release configurations had)
minifyEnabled false
shrinkResources false
versionCode and versionName must be greater than preview version in app level build.gradle file.

Application with the same package but with a different signature

I upgraded my Android studio to 1.4. Now when I'm deploying my app to my device I get the message that the device has an application with the same package but a different signature. How is this possible? I already did some research and I looked up my debug.keystore, but this hasn't changed since 13/03/2015. Anyone has any idea how I can fix this?
The problem is the keys that have been used to sign the APKs, by default if you are running directly from your IDE and opening your Emulator, the APK installed in the Emulator is signed with your debug-key(usually installed in ~/.android/debug.keystore), so if the previous APK was signed with a different key other than the one you are currently using you will always get the signatures conflict, in order to fix it, make sure you are using the very same key to sign both APKs, even if the previous APK was signed with a debug-key from another SDK, the keys will definitely be different.
Also if you don't know exactly what key was used before to sign the apk and yet you want to install the new version of your app, you can just uninstall the previous application and reinstall the new one.
for more info go through This
Hope this Helps...
Debug builds are signed with the SDK keystore which is generated when you install the Android SDK. On Linux / OSX it is located at ~/.android/debug.keystore.
The message you had means that you have a debug build installed and you want to install an App Store build on it (or the other way around).
This can also happen when you deploy from a different machine.

Android app cannot install after export

When the app in the development stage, I get the apk from the "bin" file and install it in a real android phone to test the app, and it works great. However when I export the apk from the eclipse, the apk can successful export but the apk cannot install in the phone, and shows
An existing package by the same name with a conflicting signature is already installed
Some people said you need to uninstall the app and install it again, but this app I want to put it on the Play Store, so it is impossible to ask users to do this.
Also, I want to use the ProGuard function, so I need to export the apk to enable this function.
Your development APK is signed with a development key. Your production APK is signed with a production key.
When you try to install a production APK over a development APK, it detects that the keys were different and refuses to "upgrade" the APK.
For production in the Google Play store you won't have this problem. All your users are already using the production version of the app. The new APK you provide is also a production version and so since the keys match, the upgrade will work without the users needing to uninstall the app.
Uninstall the app on your phone then re-install it

Get warning : re-installation failed due to different application signatures when update version application

on my device installed my app from play store, but I Get warning : re-installation failed due to different application signatures when update new version application from eclipse.
i want not clear data from old version, when new update.
how to fix it ?
Uninstall the app from the device.
If you have the release version of your app on the device, and your debug version has the same package name, it must be signed by the same signing key. But your debug version will be signed by your debug signing key, and your release version will be signed with your production signing key, which are not the same.
Eventually, if you switch to using the new Gradle-based build system, you will be able to have the debug and release versions use different package names, which will allow them to be installed at the same time, even with different signing keys.
Until then, though, you can have either the app from the Play Store or your debug build from Eclipse installed, but not both.
Delete your app from your device and then run it from Eclipse. This happens, because the debug certificate, that is used to deploy apk's to during development is different from your key, that you signed your released apk with.

Categories

Resources