I just installed Android Studio and I've been trying to figure out for the past 3 hours why it is that when I try to run my newly created project on a emulated phone it doesn't work. It's not even that the program doesn't work, it's that it freezes the moment I open it. I've tried uninstalling/reinstalling HAXM, SDK's for the phone, and recreating the phone / wiping the data on the phone and retrying, and nothing's worked so far. I'm wondering if anyone else has experienced this problem or knows what causes it? Please see picture to see what the problem is. P.S I'm using Android Studio on Windows. My system is beefy and should be able to run the emulator fine. I have Virtualization Enabled too.
This help me in getting it to work: switch off HyperV on Windows:
open Powershell as Administrator and run:
bcdedit /set hypervisorlaunchtype off
Reboot afterwards. Alternatively, run 'optionalfeatures' and select the HyperVisor platform to remove. To test if it really worked, run:
emulator.exe -verbose -avd <YOUR AVD NAME>
You can list the AVDs with 'emulator.exe -list-avds'.
Not my credits, but those of 'viet-quocnguyen'. See https://github.com/microsoft/WSL/issues/6471#issuecomment-770417782
My app had compiled and then it was installing the apk in my phone when a popup came asking me that the new installation will uninstall the previous version and then install the new one. I clicked OK but then after a while it shows this error:-
01/14 10:43:22: Launching app
$ adb install-multiple -r -t
E:\projects\Track\app\build\intermediates\instant-run-apk\debug\app-debug.apk
E:\root\Desktop\projects\Track\app\build\intermediates\split-apk\debug\slices\slice_4.apk
E:\projects\Track\app\build\intermediates\split-apk\debug\slices\slice_2.apk
E:\root\Desktop\projects\Track\app\build\intermediates\split-apk\debug\dep\dependencies.apk
E:\projects\Track\app\build\intermediates\split-apk\debug\dep\dependencies.apk
E:\projects\Track\app\build\intermediates\split-apk\debug\slices\slice_0.apk
E:\projects\Track\app\build\intermediates\split-apk\debug\slices\slice_4.apk
E:\root\Desktop\projects\Track\app\build\intermediates\split-apk\debug\slices\slice_1.apk
E:\root\Desktop\projects\Track\app\build\intermediates\split-apk\debug\slices\slice_5.apk
E:\projects\Track\app\build\intermediates\split-apk\debug\slices\slice_6.apk
E:\root\Desktop\projects\Track\app\build\intermediates\split-apk\debug\slices\slice_9.apk
E:\projects\Track\app\build\intermediates\split-apk\debug\slices\slice_8.apk
E:\root\Desktop\projects\Track\app\build\intermediates\split-apk\debug\slices\slice_7.apk
E:\projects\Track\app\build\intermediates\split-apk\debug\slices\slice_1.apk
E:\root\Desktop\projects\Track\app\build\intermediates\split-apk\debug\slices\slice_3.apk
E:\root\Desktop\projects\Track\app\build\intermediates\split-apk\debug\slices\slice_0.apk
E:\projects\Track\app\build\intermediates\resources\instant-run\debug\resources-debug.apk
E:\root\Desktop\projects\Track\app\build\intermediates\split-apk\debug\slices\slice_2.apk
E:\projects\Track\app\build\intermediates\split-apk\debug\slices\slice_3.apk
E:\projects\Track\app\build\intermediates\split-apk\debug\slices\slice_5.apk
E:\projects\Track\app\build\intermediates\split-apk\debug\slices\slice_9.apk
E:\root\Desktop\projects\Track\app\build\intermediates\split-apk\debug\slices\slice_6.apk
E:\projects\Track\app\build\intermediates\split-apk\debug\slices\slice_7.apk
E:\root\Desktop\projects\Track\app\build\intermediates\split-apk\debug\slices\slice_8.apk
$ adb shell pm uninstall com.saveme.rehaan.track
Unknown failure (at android.os.Binder.execTransact(Binder.java:674))
Error while Installing APKs
Can someone please help me as to how i can solve this.
I had exactly same issue after moving the project files from one folder to another one and I solved it like this:
1. File -> Settings -> Build, Execution, Deployment.
2. Instant Run -> disable "I found it's enabled, then I disabled it".
3. Apply -> OK
nothing more.
Try below following steps:
While installing any app from play store it shows popup in order
to uninstall some apps to make free space for new app.
Uninstall some apps from your phone in order to free some space.
Clean your project (Build --> clean Project)
Run Again
If above solution does not work
Generate Debug apk.
Transfer apk in your phone and install from there.
Uninstall other apps until your app does not install.
------------ Hope it will work for you---------------
I am trying to run my application on my Device from the Eclipse In windows.But my device is not detecting there in the eclipse.
My device driver is updated. In My device, I turned on "USB debugging mode" in Settings->Application->Development and also "Allow installation of non-market Applications" in Settings->Application->Development. And in Eclipse Target tab, selected "Always prompt to select device". My ProjectBuildTarget is not newer than my device's version. And tried adb kill-server also.
When i run adb devices it shows nothing in my command prompt.
How do I get Eclipse to load my app to my phone instead of my AVD?
When i tried it in my Mac machine It works perfectly..
Any solutions? Please suggest me..
Please try the following:
Go to settings in your phone
Go to storage menu
Select connect as MTP
Worked for me!
If you are using a MAC OS.... no need to install the Driver
But for Windows, try this http://developer.android.com/training/basics/firstapp/running-app.html#RealDevice
Debugging to phone
Please see the link above, the process is defined there from google.
close you AVD if its running, then re-plug your Mobile device, check in your phone USB debugging notification should come.
try deleting your AVD and leave your phone connected, then restart your IDE. Make sure you've downloaded the OEM USB drivers. If it still doesn't appear on the list, hit refresh then just run your app.
I am currently trying to compile and test a small Android Application.
I am using Eclipse, and have SDK 4.2 (Api Level 17) installed.
I've set
<uses-sdk android:targetSdkVersion="17" android:minSdkVersion="8" />
although I've tried also different values (i.e. 17/17).
I do not use any GoogleAPI functions, nor do I use functions that are not available in API Level 8. Or at least I do not get any compile errors or warnings in that regard.
When I compile the project and run it on a real device running Android 2.2.1 the Application runs fine. However when I try to run the application on an emulator (Android Virtual Device) with Android 4.2, Api Level 17 I get the following error:
[2012-12-10 21:10:29 - SoftKeyboard] Installation error: INSTALL_FAILED_VERSION_DOWNGRADE
[2012-12-10 21:10:29 - SoftKeyboard] Please check logcat output for more details.
[2012-12-10 21:10:29 - SoftKeyboard] Launch canceled!
Logcat however is empty. I have really no clue, what this error even means...
It means you're trying to install an app with the same packageName as an app that's already installed on the emulator, but the one you're trying to install has a lower versionCode (integer value for your version number).
You might have installed from a separate copy of the code where the version number was higher than the copy you're working with right now. In either case, either:
uninstall the currently installed copy
or open up your phone's Settings > Application Manager to determine the version number for the installed app, and increment your <manifest android:versionCode to be higher in the AndroidManifest.
or https://stackoverflow.com/a/13772620/632951
You can also consider adding -d flag to adb install. It should ignore this error.
adb install -r -d abc.apk
First uninstall your application from the emulator:
adb -e uninstall your.application.package.name
Then try to install the application again.
This was happening in my project because I was using an XML resource to set the version code.
AndroidManifest.xml:
android:versionCode="#integer/app_version_code"
app.xml:
<integer name="app_version_code">64</integer>
This wasn't a problem in prior versions of adb, however, as of platform-tools r16 this is no longer being resolved to the proper integer. You can either force the re-install using adb -r or avoid the issue entirely by using a literal in the manifest:
android:versionCode="64"
This can happen when trying to install a debug/unsigned APK on top of a signed release APK from the Play store.
H:\>adb install -r "Signed.apk"
2909 KB/s (220439 bytes in 0.074s)
pkg: /data/local/tmp/Signed.apk
Success
H:\>adb install -r "AppName.apk"
2753 KB/s (219954 bytes in 0.078s)
pkg: /data/local/tmp/AppName.apk
Failure [INSTALL_FAILED_VERSION_DOWNGRADE]
The solution to this is to uninstall and then reinstall or re run it from the IDE.
In Marshmallow, I got this error,
Installation error: INSTALL_FAILED_PERMISSION_MODEL_DOWNGRADE
Please check logcat output for more details.
Launch canceled!
Looking for solution I searched and came here.
I deleted the app but still have this problem in Nexus 6. Later found that in,
Settings > Apps > [My app name] have to removed for all user.
INSTALL_FAILED_VERSION_DOWNGRADE
All Android apps have a package name. The package name uniquely identifies the app on the device. If same packageName as app that's already installed on the device then this error Showing .
You can uninstall the application from your device first and
then install the fresh one .
You could simply increase the number by one each time a new version is released.
I was having the same problem. I installed with
adb shell pm install --user <userId> test.apk
For some reason, there was no icon on the screen. It was a debug build and all other consecutive installs were not working. Simply uninstalling the package helped.
adb uninstall com.package.name
According to sdk src code from ...\android-22\android\content\pm\PackageManager.java
/**
* Installation return code: this is passed to the {#link IPackageInstallObserver} by
* {#link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if
* the new package has an older version code than the currently installed package.
* #hide
*/
public static final int INSTALL_FAILED_VERSION_DOWNGRADE = -25;
if the new package has an older version code than the currently installed package.
I was having same problem. I was getting error when i tried to run in my android device not emulator.
sudo ionic run android
I am able to fix this by running
adb uninstall com.mypackage.name
you can try this:
adb install -r -d -f your_Apk_path
Do the following:
Simply uninstall the previous version of your application
Re-run the command
Enjoy :)
this happened to me when I imported an Android Studio App into eclipse.
I figured out the andoridmanifest.xml file needs to be slightly modified when importing from android studio project. I created a new test project, and copied over the headings to make it match. voila, issue solved.
This error appears in my android project with multiple kind of gfx files. At the end no change in the manifest file was accepted.
Because my lack of knowledge about the android devices I forget that my test device has a second User. This User also has an installed version of my app so I also have to delete the app for this user account and it works.
It may be a problem with the Google Play Services dependencies rather than an actual app version issue.
Sometimes, it is NOT the case that:
a) there is an existing version of the app installed, newer or not
b) there is an existing version of the app installed on another user account on the device
So the error message is just bogus.
In my case, I had:
implementation 'com.google.android.gms:play-services-maps:16.0.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.android.gms:play-services-gcm:16.0.0'
But when I tried
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'com.google.android.gms:play-services-gcm:17.0.0'
I got androidX related errors, as I had not yet upgraded to androidX and was not ready to do so. I found that using the latest 16.x.y versions work and I don't get the error message any more. Furthermore, I could wait till later when I am ready, to upgrade to androidX.
implementation 'com.google.android.gms:play-services-maps:16.+'
implementation 'com.google.android.gms:play-services-location:16.+'
implementation 'com.google.android.gms:play-services-gcm:16.+'
Uninstall your current apk from the device then run
sudo adb uninstall com.package.name
It is the command to uninstall the apk via pc.
Then retry the build
the thing that kept on killing me was that i didn't know that this app was installed for my guest account (although I had uninstalled it for the other accounts..)
so i searched for the app in the app manager, and simply clicked on uninstall for all users
Just uninstall the previous Apk and install the updated APK
I installed Android x86 on Virtualbox on my Win7 pc, to run the apps I create with eclipse in it.
I'm following a tutorial ( This one ) but I can't get the connecting part right.
When I boot my android virtual machine, i press ALT + F1 and type "netcfg", I see that the "eth0" port has no address and is DOWN.
If I type "dhcpcd" it dynamically gives it an IP so this is the configuration:
eth0 UP 192.168.10.74
and that fine, I can proceed to give an "adb connect 192.168.10.74" on Windows' cmd, and it works.
But, when I shut down or reboot the android virtual machine all settings are lost!!! How can I make it work?
There is a change in the step 5 of the process.
Select Installation - Install Android-X86 to hard disk
Hope this solves the problem.