Android Studio is unable to install my APK - android

Error below
DELETE_FAILED_INTERNAL_ERROR
Error while Installing APK
Below which I have tried for solving this issues. All of these are not working.
I have tried changing the package name.
I have tried clean project.
I have tried manually delete the app on the device.
In order to run the apk on the device, I need to download the apk by copy and paste the apk to a folder in the device and install from there.
Other weird things are. Only happen one of my device. I can download the apk to another device just fine.
Any suggestion is welcomed. Thanks in advance.

The problem is on my xiaomi device, it auto update to new version, all of sudden the enable of install via USB required to sign in Mi account.
solution

Related

Share flutter app as APK which works on real devices

I want to build APK from the flutter project and share it to someone to review. I followed the docs, but the problem is when he tries to open the APK he gets
"there was a problem parsing the package"
I tried it on another device and gets
"App not installed"
I think the problem is in the APK file, So how I can build a correct APK that works on real devices?
I keep the name of the file "app.apk" does that matter?
from the Flutter docs, to build an APK from the command line:
Run flutter build apk
(The flutter build command defaults to --release.)
This command results in an APK file:
[project]/build/app/outputs/flutter-apk/app-release.apk
take note of the path and ask name(app-release.apk)
if you would like to debug why the apk not running on physical device, install this app https://fbflipper.com/ on your system, and connect your mobile device though a usb cable, now when you run the apk, on the flipper app you will receive crash report that will help you understand why your app is crashing!

Installation failed with message INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES. not able to install any application in a particular device [duplicate]

I tried to reinstall an apk
$adb install -r new.apk
And it shows the error:
Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]
One solution is to uninstall and install the new.apk, that works fine.
But I'm wondering whether I could re-build an apk and re-install without the uninstallation. Eg. change some config in the AndroidManifest.xml, or not sign the APK, etc.
It would be great appreciated if you could tell me the whole meaning of the "INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES".
It means the new copy of your application (on your development machine) was signed with a different signing key than the old copy of your application (installed on the device/emulator). For example, if this is a device, you might have put the old copy on from a different development machine (e.g., some other developer's machine). Or, the old one is signed with your production key and the new one is signed with your debug key.
I ran into this while testing on a new Xoom. I had previously installed my app from the Marketplace. Later while trying to test a new version of the app I ran into this error.
I fixed it by removing the app that was installed via Marketplace (just hold and drag to the trash). Thereafter I was able to deploy my development version without any issue.
This happened to me when another developer on the team built our app on the hardware device I was trying to deploy to. Uninstalling the app from hardware fixed my problem.
This is the command to uninstall the app from device using adb:
adb uninstall <package name>
I got this error even after uninstalling the original APK, which was mystifying. Finally I realized that I had set up multiple users on my Nexus 7 for testing and that the app was still installed for one of the other users. Once I uninstalled it for all users the error went away.
I changed the package name while coding an update so that I could debug it on my device via Eclipse, without deleting the old version that was installed. Without reverting the package name I was using when trying to reinstall, I got this same error. Using the same package name the reinstall was successful.
Just delete the old build from the device and reinstall the same. Because device.keystore is already exist in the device so just uninstall the build and reinstall the APK thats all..
Thanks
I faced an another use case where I got the similar error.
When At first I got the error, I panicked, and removed /data/data/{package.name}
After that I tried, and my problem was still present.
Then I tried uninstall, it failed.
I then removed the apk file present in /system/app (required root access), and tried uninstall and it was successfull.
After that I tried re-installing the apk, it worked.
If you encounter a failed deployment to an Andorid device or emulator with the error "Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]" in the Output Window, simply delete the existing app on the device or emulator and redeploy. Debug builds will use a debug certificate while Release builds will use your configured certificate. This error is simply letting you know that the certificate of the app installed on the device is different than the one you are attempting to install. In non-development (app store) scenarios, this can be indicator of a corrupted or otherwise modified app not safe to install on the device.
I had the same problem until I realised I had the simulator running and adb was trying to install on that
For what it is worth, I ran into this problem after adding a new plugin to my Cordova project. I had been having cordova do builds and install directly on the device via USB.
I fixed it by uninstalling the app from the device and on the next deploy there were no problems.
Nothing from above worked for me. The problem for me was that I had wrong source in my Java Build Path for android-support-v7-appcompat. When you go to Project> Build Path> Configure Build Path>. Under the Source tab make sure you have android-support-v7-appcompat/gen , android-support-v7-appcompat/libs and android-support-v7-appcompat/src and nothing else. Click OK and it should work.
I've had the same error today, but the problem wasn’t exactly the same. I’m using ADB with Android installed in VirtualBox. I tried to install different versions of my app (signed / not signed, debug / release mode) and got two errors alternatively : INSTALL_FAILED_UID_CHANGED and INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES.
Now, when looking at /data/data/{package.name}, I found a bunch of files that were still there after uninstalling the app. I tried to rm -rf them without success : I got I/O errors.
The solution to this was :
Shut down the VM
Mount the VDI image with vdfuse (read/write)
Repair the Partition1 image file with e2fsck
Umount and restart the VM
Since the verification is based on package's name, you can change the package name inside your config.xml or manifest file for another name you want.
When publishing your app don't forget to change back the name!
I had this problem trying to execute gradle task connectedDebugAndoidTest (or connectedAndroidTest) on Genymotion. Running it on normal emulator solved the problem.
I think , your app installed by other account.( multiple account mode feature ) You can uninstall app in Setting>Apps>"app name"> Uninstall

How to uninstall an app completely from android(to solve signature errors)?

I am developing an app from so many days and i use my phone to test the app. So android studio always installs my app in my phone directly through ADB.
Today i made a signed apk from android studio and when i tried to install it. It gave me an error "App not installed - an existing package by the same name with a conflicting signature is already installed"
Check This Image :- http://i.stack.imgur.com/qumOm.png
So i uninstalled the old app and when i tried to install the signed apk it gave me error again"App not installed"
I Think my old app still left some Data in my phone.
So i used Titanium BackUp Manager and in first removed the app data and then uninstalled the old app.
This solved the problem and i was able to install my new app now.
Any,Other suggestions are welcome ??
You can get rid of the signature by removing /system/app/ folder from the device.
I also had issues installing gcam ports on my android device.
The above solution worked for me and I was able to install the app after removing
/system/app/GoogleCameraLegacy folder through TWRP recovery.

Unsigned Android apk file won't install

I created an unsigned APK file from my eclipse project to demo my app on another device. It runs fine on the emulator and on a connected phone.
When I emailed it and downloaded the apk file ( I have allow apps from unknown locations ticked on ) but the install fails with message. "Installation failed" and not much more info.
Any ideas what I can check?
Make sure that the o.s. version of phone on which you trying to install the app is meet the minSdkVersion that you declared in your manifest file. Or if that app is already installed then unistall that and install again. May be it works.
I had the same problem. It was solved by uninstalling the version I had installed via usb from Eclipse. Once that version was off my phone I could email myself APK's and they would load fine.
All your apps need to be signed. Read here:
http://developer.android.com/tools/publishing/app-signing.html
Sign it with something like jarsigner
On the device, go to Settings->Applications->Unknown Sources and make sure that is ticked.
Make sure that there is enough space on the phone, and that the phone is running on the right version of Android.
Finally, if this still doesn't work, then sign your .apk file.
I had the same problem and in the end just signed apks which let them install perfectly. Alternatively if you use something like astro of the play store to backup your apk from the phone running it and send it over to the other phone - this also works. I think it might not be packed right or for some reason it requires a signature to install. It could also be that conflicting signatures are found on the new phone.

How to deal with INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES without uninstall?

I tried to reinstall an apk
$adb install -r new.apk
And it shows the error:
Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]
One solution is to uninstall and install the new.apk, that works fine.
But I'm wondering whether I could re-build an apk and re-install without the uninstallation. Eg. change some config in the AndroidManifest.xml, or not sign the APK, etc.
It would be great appreciated if you could tell me the whole meaning of the "INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES".
It means the new copy of your application (on your development machine) was signed with a different signing key than the old copy of your application (installed on the device/emulator). For example, if this is a device, you might have put the old copy on from a different development machine (e.g., some other developer's machine). Or, the old one is signed with your production key and the new one is signed with your debug key.
I ran into this while testing on a new Xoom. I had previously installed my app from the Marketplace. Later while trying to test a new version of the app I ran into this error.
I fixed it by removing the app that was installed via Marketplace (just hold and drag to the trash). Thereafter I was able to deploy my development version without any issue.
This happened to me when another developer on the team built our app on the hardware device I was trying to deploy to. Uninstalling the app from hardware fixed my problem.
This is the command to uninstall the app from device using adb:
adb uninstall <package name>
I got this error even after uninstalling the original APK, which was mystifying. Finally I realized that I had set up multiple users on my Nexus 7 for testing and that the app was still installed for one of the other users. Once I uninstalled it for all users the error went away.
I changed the package name while coding an update so that I could debug it on my device via Eclipse, without deleting the old version that was installed. Without reverting the package name I was using when trying to reinstall, I got this same error. Using the same package name the reinstall was successful.
Just delete the old build from the device and reinstall the same. Because device.keystore is already exist in the device so just uninstall the build and reinstall the APK thats all..
Thanks
I faced an another use case where I got the similar error.
When At first I got the error, I panicked, and removed /data/data/{package.name}
After that I tried, and my problem was still present.
Then I tried uninstall, it failed.
I then removed the apk file present in /system/app (required root access), and tried uninstall and it was successfull.
After that I tried re-installing the apk, it worked.
If you encounter a failed deployment to an Andorid device or emulator with the error "Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]" in the Output Window, simply delete the existing app on the device or emulator and redeploy. Debug builds will use a debug certificate while Release builds will use your configured certificate. This error is simply letting you know that the certificate of the app installed on the device is different than the one you are attempting to install. In non-development (app store) scenarios, this can be indicator of a corrupted or otherwise modified app not safe to install on the device.
I had the same problem until I realised I had the simulator running and adb was trying to install on that
For what it is worth, I ran into this problem after adding a new plugin to my Cordova project. I had been having cordova do builds and install directly on the device via USB.
I fixed it by uninstalling the app from the device and on the next deploy there were no problems.
Nothing from above worked for me. The problem for me was that I had wrong source in my Java Build Path for android-support-v7-appcompat. When you go to Project> Build Path> Configure Build Path>. Under the Source tab make sure you have android-support-v7-appcompat/gen , android-support-v7-appcompat/libs and android-support-v7-appcompat/src and nothing else. Click OK and it should work.
I've had the same error today, but the problem wasn’t exactly the same. I’m using ADB with Android installed in VirtualBox. I tried to install different versions of my app (signed / not signed, debug / release mode) and got two errors alternatively : INSTALL_FAILED_UID_CHANGED and INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES.
Now, when looking at /data/data/{package.name}, I found a bunch of files that were still there after uninstalling the app. I tried to rm -rf them without success : I got I/O errors.
The solution to this was :
Shut down the VM
Mount the VDI image with vdfuse (read/write)
Repair the Partition1 image file with e2fsck
Umount and restart the VM
Since the verification is based on package's name, you can change the package name inside your config.xml or manifest file for another name you want.
When publishing your app don't forget to change back the name!
I had this problem trying to execute gradle task connectedDebugAndoidTest (or connectedAndroidTest) on Genymotion. Running it on normal emulator solved the problem.
I think , your app installed by other account.( multiple account mode feature ) You can uninstall app in Setting>Apps>"app name"> Uninstall

Categories

Resources