Fail to install random APKs on Android - android

I'm running AICP on my Nexus 5, with android 5.1.1. I've been trying to install a few APKs I've found online, and I always get the same error which is Failure [INSTALL_FAILED_CONTAINER_ERROR].
I see other people online who have been able to install them, so I'm unsure why mine is failing. Although it only seems to happen with some APK files and not others. Is there anyway I can figure out more on why it would fail to install on my device?
If it helps I've tried running the APK files on phone and through ADB and same problem.
I've tried running my own APK files (signed) and they work perfect.
Unknown sources is definitely allowed. Also free space is about 6GB at the moment, so don't think thats the issue.

This usually happens when android:installLocation is set to "preferExternal" and your AVD has a too small SD card. You have to increase the size of the SD card or change installLocation to auto in AndroidManifest.xml as below, but I think you can't that.
android:installLocation="preferExternal"
to
android:installLocation="auto"
Also please have a look at this

I finally found a work around for the installation problem! Due to the help from varunkr, it does seem to be a storage problem from what I can tell. I was able to get it working though by changing the default install location of my device. Basically I had to do the following:
Connect my device to my computer with adb, rooted etc
I started root by typing adb root
Changed the default install location to internal by going adb shell pm set-install-location 1 in console.
Typed adb install applicationName.apk and everything work perfectly!!
I'm not sure if you want to place the default application installation back afterwards by placing it back to auto as follows: adb shell pm set-install-location 0
But by doing this I was able to get the application to install, and am happy I can get around it now.

Related

Apk is disappearing after moving to system parition

I'm trying to install my apk on system partition. I've rooted device and here are the steps I'm following,
adb install -d -r <apk_name>
Now apk gets installed in /data/app/<apk_name>/
Move all contents present from /data/app/<apk_name> to /system/priv-app/<apk_name>
Clear the contents within /data/app/<apk_name> and reboot the device
Post reboot not able to find my apk under adb shell pm list packages | grep <apk_name>
I'm trying to read and write value to secure setting which is asking my app to be in system partition. When I'm trying to move I'm facing this issue. I could not find something suspicious from logs while installing the apk.
Tried all possible solutions listed here (Android 5.0/Lollipop: Force rescan of /system/priv-app) but none didn't help.
Any help to debug this issue would be really helpful.

No space left on device when I install a apk use adb

I have started an Android emulator, I have started getting the following error when i use adb to install a apk and this apk's size is only 1M.
There is enough space in data partition.
Can anyone suggest a reason this might be happening?

How to root Genymotion Android Emulator?

I have downloaded Genymotion Android Emulator for personal use. I searched over internet to root this device, forums says that via adb shell its already rooted -"agreed".
Sumits-MacBook-Pro:sdk eSumit$ adb -s 192.168.57.102:5555 shell
root#vbox86p:/ #
root#vbox86p:/ # whoami
root
Found Genymotion configure apk, it will help to root access, if checkbox get clicked - "always allow su access", I did that as well, and then it get stuck like here. (see below)
If I restart by myself, it shows that no root access ?
May I know what I am missing here ?
Here are the pictures sequence :
I have also followed various tutorials e.g. Youtube - how to root genymotion emulator Android 7.0 but no solution yet
Apparently, there is some problem with the su binary. You can re-install it by downloading SuperSU zip archive and dropping it onto the device window. Restart will be needed.
Please note that the current version (2.79) does not seem to work due to missing /etc/fstab file on Genymotion systems. It works fine with 2.46.
Source: https://www.youtube.com/watch?v=YC9Bz5xVHCU
Make sure you have already installed Genymotion ARM Translation.If already,
Drag UPDATE-SuperSU-v2.46.zip to Genymotion Emulator(not sure other versions of SuperSU zips), and drop on it.It will confirm to flash zip file to emulator, click OK .After waiting for a while, you will get successfully message.Then, restart your emulator and check it with any Root Check App.Here is Tools file if you haven't it.I tested it on Google Nexus 5,Android 6.0 Emulator.I hope this will help for you.
Maybe it uses Iso file mounting system like Bluestacks that's why I guess it can't be rooted and also if it says its rooted then you can use UltraISO to modify root files only if it uses ISO file system.

Installation error: INSTALL_FAILED_UID_CHANGED no root

I have checked all the solutions, comments and answers of all other questions in StackOverflow.
I have been running, compiling and debugging my app for months. But suddenly it started to appear this message in my Eclipse when using my Nexus to play with it.
MOBILE:
I have no root !!! (It's a Nexus, and I have no root, and all the answers in other Stackoverflow's questions need root to be executed)
The application is uninstalled, there's no trace of it in "Applications"
Since I don't have root access, I can not access to /data/data folder, or /data/local, or /data
I do know problem would be solved resetting the phone to factory settings, but, sincerely, I can not.
ECLIPSE:
I have cleaned the project many times, restart Eclipse and even update it
I can not change the name of the project (as one solution suggests), since it's a long time project and I can not change it
Console says:
Installation error: INSTALL_FAILED_UID_CHANGED
Please check logcat output for more details.
Launch canceled!
Logcat says:
01-05 12:18:19.265: W/ActivityManager(761): No content provider found for permission revoke: file:///data/local/tmp/MyApp.apk
01-05 12:18:20.855: W/PackageManager(761): Package couldn't be installed in /data/app/com.myapp-1.apk
I can install, uninstall other APK/applications with no problems at all. So it's not about permissions in /data folder/subfolders
CONSOLE:
If I try to uninstall (with -d or any other parameter) the app it says: "Failure" (because adb does not find the app in the phone)
So, I'm not debugging with virtual machine / emulator. I have a Nexus no-rooted with no trace of the application, and I can not build the app from Eclipse to the device.
Thank you
I had the same issue in my non-rooted Nexus 5. I managed to solve it without root access nor Factory reset.
For this device, I managed to solve it by going to Settings -> Storage -> Misc and try to delete any files related to the faulty app (in my case, an .apk that was pushed from Android Studio and a .db file). I also clicked on Cached data to wipe the cache for all apps.
I don't know exactly which of the two things triggered the solution. You probably want to try to delete some files in Misc before wiping the cached data, since it seems less of an overkill.
It seems to be that there were some remaining files from a previous installation which weren't wiped with the uninstall (probably an issue in the Android installation system). These files aren't accessible without root access, since they are under the /data/local/ folder. Apparently the Storage tools for the Nexus 5 have permission to delete files under that folder.
I don't know whether other devices have a similar set of storage tools.
Downloading app from play store will resolve the issue.
To continue development on the app, uninstall the currently installed app and just launch the app from eclipse.
It works fine.
This may seem odd, but my pointy-haired boss just had this issue and tried everything we could think of. Just would NOT install due to the INSTALL_FAILED_UID_CHANGED error.
He uninstalled some other apps (games) and suddenly it would install. Maybe it is an issue of disk space on internal card? Dunno, but worth a try when someone else hits it.
First time this happened I tried installing from eclipse, from command line etc....
Everything failed so I did a factory reset which then worked.
24 hours later it happened again.
Not wanting to do another factory reset, I tried all the same things again to no avail.
Lastly I tried downloading our current app from the appstore, which miraculously worked.
I then used adb to reinstall.
So if you have a version of your app in the app store, try installing that to get something on your phone, then do a reinstall "adb -d install -r $PACKAGE.apk
Hope this helps someone.
This (or some other magic) helped me:
adb shell pm clear MY_PACKAGE_NAME
I can solve this like below without rooting on my Nexus 5.
Push your app to /sdcard/
adb push test.apk /sdcard/
adb shell
adb shell pm install -l /sdcard/test.apk
-l option means - pm install: installs a package to the system. Options:
-l: install the package with FORWARD_LOCK.
Here are some other things to check/try that are safe to do:
Make sure your package name is 100% unique and not colliding with
another app. You could temporarily change it to test.
Try powering your phone off and then back on to clear
data caches.
Try a soft reset for your device (which might be the
same as powering off/on).
Try deleting Cached Data under Settings -> Storage, this will clear all cached App data at once, but it does the job (in my case)
This is because of if you have install the app with same package name. So try to remove that one.
I could only fix this by rooting. I know you don't want to do that, but it worked for me. I downloaded Titanium Backup then found my uninstalled app crossed out in the list on Titanium Backup. I couldn't get rid of that crossed out one until I went to Batch Actions then Remove orphan data. That allowed me to re-install my app and it worked well.
This worked for me:
adb install -l -r <'apk_name'>.apk
-l = forward lock
-r = reinstall
I had this exact same problem. What finally worked for me was to change the applicationId (your package name) in build.gradle to something different, then rebuild the project, and voilĂ , successful deployment.
What led to this situation was that I'd copied an existing Android Studio project into a new one, and was working off of that new one. The thing is, I'd never deployed the original apk on my device before, and was only trying to deploy the new copy of the app.
I was using a device that was just for testing, so I just reset the whole device. It worked for me anywho.
This solution worked for me:
Put your APK to the device's storage/sd card
adb shell pm install -l -r "/sdcard/<apk_filename>.apk"
-l = forward lock
-r = reinstall
For no root Device you need you need to delete the app from the app list in the device:
go to "settings"
go to "storage"
on third tab "downloaded apps" locate your app
you can delete it from there
Works for me!
In my case changing the package name of the GCM signature worked. since it uninstalls the complete package.
For more detailed explination click here
<permission
android:name="com.androidcodelab.sampleproject.permission.C2D_MESSAGE"
android:protectionLevel="signature"/>
<uses-permission android:name="com.androidcodelab.sampleproject.permission.C2D_MESSAGE"/>
Package name of the project changed to :
<permission
android:name="com.androidcodelab.xyz.permission.C2D_MESSAGE"
android:protectionLevel="signature"/>
<uses-permission android:name="com.androidcodelab.xyz.permission.C2D_MESSAGE"/>
and then I reverted back to the actual package name
For android studio go to File-> Project Structure -> app -> Flavors and your right side you will see Application Id field just change Application Id and you are ready to go... :)
Go to Run/debug configurations.
Under Android App delete "app".
Then add another configuration under module: app
For me the only way was to root the phone and clear /data/data/ directory. Here are the steps:
1. Open web browser on mobile device
2. Open website: https://towelroot.com/
3. Click on lambda sign to download Towerl Root and install it afterwards
4. Open Towel root app and click on button "make it rain". If it says: "device not compatible" google other wait to root the device.
5. Download SuperSU app from Play Store
6. Download Terminal Emulator app from Play Store
7. Run Terminal Emulator
8. Type following command in terminal emulator:
su
9. Allow superuser access for terminal emulator
10.Type following command in terminal emulator, substitute 'package_name' with your app's package name:
rm -r /data/data/package_name
I tried all above and NADA!
the ONLY way it works for me (NON ROOTED DEVICE) was:
1.- Change on Project structure [Ctrl+Alt+Shift+S]->Flavors: the Application Id, for example:
'com.example.something' to 'com.example.somethingxx'.
(which is the same as changing on the build.gradle file)
2.- Refactor package name of the project to the SAME NEW NAME you used on Application Id: 'com.example.somethingxx'
This will ensure you are installing a new App on the device... let me know!

Unable to debug via eclipse on phone with Jelly Bean

I have a nexus S for sprint that I am using as a developer phone rooted to be running android 4.1. Eclipse recognizes the phone, drivers, etc. I can run "adb devices" and the phone id is displayed. However, if I try to debug my app or any other imported project I get the following error:
Unable to open zip '/data/local/tmp/com.myapp.apk': Permission denied
(I would post the image but haven't posted here before)
If I manually transfer the .apk and install via Astro, everything runs perfectly. I am considerably lost and any help would be appreciated.
For anyone looking at this with a more recent version of the siyah kernal, if you don't wish to switch your kernel, you can use the "ExTweaks" app to change a settings under "MISC" called "ADB Binary Mode". I set this to "Development ADB"(was "Normal ADB") and can now successfully debug with eclipse! :D
I have a custom ROM installed in my Galaxy S2. Searching by google i came to this post: http://forum.xda-developers.com/showpost.php?p=29454043&postcount=203
The problem in my case was the kernel too (Siyah 3.5.2).
I installed another kernel for JB (http://developer.clockworkmod.com/downloads/51/3354/kernel-cm-10-20120801-i9100-signed.zip) and the problem was solved.
Basically
/data/local
doesn't have the right permissions, so a simple:
adb shell
cd /data
chmod 777 local
should work. (Not sure if the new permissions are overbroad, but I'm not too worried)
As per ekim's answer, I had the same issue, again, a Galaxy S2, etc. The latest version of Siyah fixes this problem and I can get back to running/debugging from Eclipse.
I updated SGS3 (I9300) to stock 4.1.1 ROM and I got the same problem.
After I unsuccessfully tried everything here and elsewhere suggested:
clean all projects
install via adb chmod 777 for /data/local/tmp (and direct subfolders)
dancing the chicken dance (dunno who suggested that, but at least it
produced some laughs ;)
etc.
I installed SiyahKernel S3-v1.6.8 and the problem was gone.
After inspecting my UMASK, I saw it's now 0000 (and it was 0077 on stock kernel), so I concluded that the wrong UMASK was the root cause of the error.
Still, as can be seen from numerous other threads on this issue out there, it's very wrong for the stock kernel to cause that problem.
Here's a quick way to see if it's a permission issue:
adb install -s Your.apk
this will install on the SDcard rather than /data/local

Categories

Resources