My APK does not re-install - android

I make my own APK and I installed it on phone. Then I change something, and I raise the versionCode from 10 to 11. But when I want to re-isntall the massage said that: "Application was not installed".
Before everything was working. When I check APK by aapt dump I see updated version in Manifest. What can I do to fix it?

Try this one:
adb uninstall <package_name>
adb install apk_file.apk
or you can use -d and -r with adb
adb install -r -d your_apk.apk

"App not installed" shows when an app with same package already installed in same device. just completely delete the first apk from your device.
Go to the Settings --> Apps --> Click on your App. ---> from menu select " Uninstall for All users ". Your app will be completely uninstalled and now you can try installing the new version with no issue.
Hope this will help you

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 install apk file issue

In Android phone, by default, there are two users, one is me, the other one is Guest.
I am doing Android app development. I install the debug mode apk by run command :
adb install myapp.apk
But when I uninstall it from :
Settings -> Apps -> (click into the app) Uninstall
the app is uninstalled but the app icon is still showing there & there is a text says it is uninstalled, if I adb install myapp.apk again now, the installation fails.
To get rid of this, I have to always switch to "Guest" user, and uninstall also from there. It is very annoying. Why adb install myapp.apk installs the APK on both users?
How can I only install the app in current user with adb so that when I uninstall it from settings it could be uninstalled completely without bothering me to switch to Guest user to uninstall again?
adb install -rf apk
This helps you in doing forceful re-installation

Manually installing an updated APK fails with "signatures do not match the previously installed version"

I've built a silly app to share among a few friends. No need to put it up on the app-store.
I built the first apk (signed), uploaded it to a web-server and all worked well.
A small issue arose, I fixed it, re-built, signed with the same keystore and uploaded it again. It now seems that I am unable to install from the new apk. The debugger tells me:
signatures do not match the previously installed version
So I uninstalled the old version by opening the app drawer and dragging it onto the "uninstall" button. When opening "Settings -> Apps", I don't see it anywhere anymore. I don't see any traces of the app on my device.
Yet I still get the above error message.
Is it possible some information still lingers on the device somewhere? Is there any way I can verify that?
Yes It is possible if somehow your old application is not removed 100% or its data is not removed.
Try:
adb uninstall "com.yourapp.yourapp"
If you don't know exactly what to put as replacement for "com.yourapp.yourapp", then you just open Android studio, Run your app while it is connected to a device and then look at Debug window.
It says:
Waiting for device.
Target device: samsung-sm_t531-xxxxxxxxx
Uploading file
local path: C:\Users\myapp\app\build\outputs\apk\myapp.apk
remote path: /data/local/tmp/com.myapp.myapp
Installing com.myapp.myapp
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.myapp.myapp"
pkg: /data/local/tmp/com.myapp.myapp
Success
com.myapp.myapp in this case is the name of the package you must use to uninstall.
I had the same issue and the adb uninstall solution did not work for me.
What worked was
On your device go to to Settings->Apps
Select your app, and in the menu select "Uninstall for all users"
Even if I had previously uninstalled the app it was still in the list there.
To me, if the app is meant to be distributed, the adb solution is a no-go: you can't ask one's friend to have the android sdk installed on their machine !
The way to go here is to edit the AndroidManifest.xml and to increment the android:versionCodeattribute in the <manifest>tag (which is the root element).
This would update your installed application
If you are seeing this while conducting connected tests, make sure to include .test when uninstalling via adb because uninstalling via app -> settings does not get rid of the test package
adb uninstall your.broken.package.test
if you just uninstall via
adb uninstall your.broken.package
your test package will still be there. This was only something i noticed while using the gradle command line, haven't come across this problem within android studio
Uninstall the old app from your phone or emulator and try to run again.
I got that error while trying to install release while signing it's certificate.
fixed with the :app Gradle task uninstallRelease and then installRelease again
If you are going in install the same app with a different signature, you may want to uninstall but keep the app's data.
adb -d shell pm uninstall -k <packageName>
adb -d install -r -t -d app.apk
For Unity users who come to this question, the best answer is indeed the one above by #Ehsan
adb uninstall "com.yourapp.yourapp"
I had already installed a previous version on my Android device then selected Development Build in Unity > Build Settings which caused the APK to use a different signature. If you install through the Android GUI it doesn't actually remove everything so you have to use ADB.
I had face same problem With POCO Mobile and Moto G30 Mobile while developing application in flutter
My Solution is:
I have open android project which automatically create in your project, in android studio and run project in connected device. It will automatically ask to uninstall old app with same package name and different signature. After click ok button it will install app.

ADB shell command uninstall Android app from Windows 7

I am doing testing of app on Android emulator. I am able to install my app via this:
adb install camera_test_debug.apk
After installing, the app name appear in the list is "camera_test". However, I can't do the uninstall with adb uninstall camera_test. It will return failure message.
Why can't I uninstall? What should be the name I put in to be able to uninstall?
Thank you.
adb uninstall package.yourapk.name
not
adb uninstall filename.apk
Check the AndroidManifest.xml, get the package name of your camera_test_debug.apk, eg. com.example.cameratest.
Then use "adb uninstall com.example.cameratest" to remove that apk.
you should uninstall your app by your package name so check your package name in manifest , then be sure that your app is debuggable.

Installing com.google.android.gms on emulator, packet exist error

I'm trying to install com.google.android.gms v 3.0.27 on my android 4.2 emulator . But when I run adb install. it execute some minuets and the say:
INSTALLATION_FAILURE_PACKAGE_EXIST
the emulator by defualt has version 2... of this package but I want to update it. What should I do?
EDIT
I tried to uninstall. After executing command, CMD just show the help of adb unistall.
I tried to install it on another emulator, Now I get this error:
Failure [INSTALL_FAILED_SHARED_USER_INCOMPATIBLE]
This will reinstall it:
adb install -r com.google.android.gms.apk
You will have to uninstall the the old version first. You can do this with ADB:
adb uninstall com.google.android.gms
The emulator by default doesn't has those files, this is one of the reasons that Google Map API V2 doesn't work on the emulator environment. So you can just create a new AVD and install you .apk file there or use the uninstall option as mentioned.

Categories

Resources