Failure [INSTALL_FAILED_ALREADY_EXISTS] [duplicate] - android

This question already has answers here:
Failure [INSTALL_FAILED_ALREADY_EXISTS] when I tried to update my application
(7 answers)
Closed 4 years ago.
command
When I try to update a new version from server by downloading apk,
then enter install it, but failed to get installed, so I used adb command to install error found pkg:
/data/local/tmp/ntsj_2018012614.apk *
Failure [INSTALL_FAILED_ALREADY_EXISTS]**

adb can't install an apk if the device already have an apk installed where the package name is the same. So, you need to remove it by using:
adb uninstall com.your.package.name
where com.your.package.name is your apk package name. Or you can use the following if you want to keep all the apk data (in case you want to update the apk):
adb uninstall -k com.your.package.name
Then you can install the apk with:
adb install yourpackage.apk
In case you don't know the package name, please read more about it at Read the package name of an Android APK

Related

uninstall app fully still appears the error INSTALL_FAILED_VERSION_DOWNGRADE when I install my app

background:
1. I have installed the APK with the 1.1.30 version built by flutter.
2. I want to install it back to 1.1.29
3. I uninstall the 1.1.30 app.
4. I install the 1.1.29 package, and it will throw the error package appears to be invalid.
5. I try to use ADB to install it, but the error will change to INSTALL_FAILED_VERSION_DOWNGRADE: Package Verification Result
6. no idea why the app built by flutter will cause this issue, even if I uninstall the app fully.
7. the solution is using ADB install -r -d [path_to_debug_apk] to replace and downgrade the app.
can someone explain why this happened? is the app can not uninstall completely? thanks.
also refer to this link: Error: ADB exited with exit code 1 Failure [INSTALL_FAILED_VERSION_DOWNGRADE]
it seems the same to me who still can not install it even though the app was removed.
some information added:
I used adb shell cmd package list packages, can not find my app but the command with adb shell dumpsys package[pageckage name] can find my app.
so weird

ADB installs apk but doesn't show under packages

I am trying to uninstall an old version of my app, and reinstall the new version via ADB on a Lollipop Android device. These are my current steps:
adb uninstall com.company.mypackagename
adb install app-release.apk
adb shell pm list packages
The original uninstall of my old app was successful and the app disappeared from the Android 5.5 device.
The new attempt to install the upgraded app returns:
adb install app-release.apk
Performing Push Install
app-release.apk: 1 file pushed, 0 skipped. 10.7 MB/s (822124 bytes in 0.073s)
pkg: /data/local/tmp/app-release.apk
Success
but when I run a list of the packages, my new APK package is not there.
adb shell pm list packages
When I try to run it anyway:
adb shell am start -n "com.company.mypackagename/com.company.mypackagename.MainActivity"
I get:
Error: Activity class {com.company.mypackagename/com.company.mypackagename.MainActivity} does not exist.
So obviously it is not installing correctly, as it is not showing in packages and unable to run - even though it shows Success. What is the best way to troubleshoot this? Any help appreciated!
I finally found the issue!!!
I'm posting here because I spent way too much time trying to figure this out, since it wasn't giving me any error messages.
I was able to get a copy of the original APK from the deployment team and analyze their AndroidManifest.xml, and saw that the original APK package name was all lowercase: "com.company.mypackagename" but the one I was building was actually using Camel-Case "com.company.myPackageName". When I tried to install it, ADB should have given an error similar to: "Application ID Does not Match", but instead it just repeatedly gave me a response of: "Success".
Hopefully this saves someone else some time!

How to solve Android error on lunching app in android studio?

I'm getting this error when i'm lunching my app:
Installation failed with message INSTALL_FAILED_UID_CHANGED.
It is possible that this issue is resolved by uninstalling an existin
version of the apk if it is present, and then re-installing.
WARNING: Uninstalling will remove the application data!
Do you want to uninstall the existing application?
I clicked 'OK' but then i'm getting this log message:
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.team.saver.app"
pkg: /data/local/tmp/com.team.saver.app
Failure [INSTALL_FAILED_UID_CHANGED]
DEVICE SHELL COMMAND: pm uninstall com.team.saver.app
Unknown failure (Failure)
i'v managed to overcome it by replacing the appId, but i need to keep the current app id and not replaced it.
i also tried deleting the package with adb and did not got response at all from the shell:
adb shell rm -rf com.team.saver.app
also tried to restart the device
But still cant find a solution, any help would be great, thanx!
Try to install android studio with proper installation of jdk .It will not generate errors if all paths are set ok.
Change you Old SDK version to latest upgrade version and then clean the project and run it again. It may solve the problem .

unistall google play service android [duplicate]

This question already has answers here:
remove or update Google play service on emulator
(5 answers)
Closed 9 years ago.
good morning
i would like to delete the google play services package from my android emulator because i tried to update it by a new version.
When i taped this command in my terminal:
./adb install com.google.android.gms.apk
I receive this message :"install failed already exist "
I tried to unistall this package by this command:
./adb -e uninstall com.google.android.gms
It show me "failure".
My version is 3.1.36 and i would like to install 4 version to run my android map app
regards.....
AFAIK You will not be able to uninstall play services as its only can be uninstalled by the administrator level. You can not uninstall it on your own as it requires root level access..
Try adb install -r com.google.android.gms.apk

Why does adb install <same-packagename-always-release> fail? [duplicate]

This question already has answers here:
Failure [INSTALL_FAILED_ALREADY_EXISTS] when I tried to update my application
(7 answers)
Closed 9 years ago.
I know that adb install will not replace an existing package if it's of a different build type (i.e. debug vs. release).
Eclipse also successfully replaces the debug apks whenever I run a debug session.
But when I attempt adb install for replacing an existing release apk with another release apk (same package name!), I get a failure message:
adb install myapp-release.apk
pkg: /data/local/tmp/myapp-release.apk
Failure [INSTALL_FAILED_ALREADY_EXISTS]
745 KB/s (34310 bytes in 0.044s)
Wasn't that supposed to work? What am I missing?
I suppose if the app is already installed, you need to supply the -r key:
adb install -r myapp-release.apk
From the adb help:
'-r' means reinstall the app, keeping its data

Categories

Resources