Error while Installing Android app on Android virtual device - android

I have created a small and simple android app. I tried installing it on an actual android device. But because it won't install, I created an AVD resembling my phone. I tried copying and installing app on that AVD and it still says that error. "Application xxx could not be installed on this phone".
Before I tried installing my app on the phone or AVD I following steps:
1. Exported an unsigned copy of application onto my hard-drive.
2. User jarsigner to sign the app
3. Verified with jarsigner that my app is signed properly.
4. Used zipalign to optimize the app resources.
I do not have an icon assigned to myapp but mandatory properties like version etc. have been specified properly.
I had initially developed app using 2.1 version but because of compatability issues with my phone I reverted code to compile on 1.5 and it still doesn't get installed either on AVD or my phone.
My AVD is on 2.1 though and code is compiled with 1.5.
Is there a place where I can see the logs as to why app is not getting installed. It would be really helpful.
Cheers

This can happen if you have a Debug version installed on the device already (from a USB debug session). Either do adb -d uninstall com.example.yourapp or uninstall in the Preferences->Applications screen on the phone itself.

Try using adb install to see if you get an error.
adb logcat will give you the logs from your device (phone or emulator) so you might find a stacktrace there.

Related

Android Studio not installing app on device, no error messages

I have a clean Android project on Android Studio (just with a "hello world' screen), and I'm trying to install the app on my Samsung Galaxy S10e.
I click the Run button, and this is what I see in the Build Output:
And the apk is generated successfully.
But it's not launched and not installed on the device (no icon, and it doesn't appear in the apps list).
When I try manually installing the apk by adb install app-debug.apk, it works. The app shortcut appears on the device, it's added to the apps list, and I can launch the app.
At first also adb install didn't work, giving out the error INSTALL_FAILED_TEST_ONLY, but I solved that by adding android.injected.testOnly=false to gradle.properties.
I tried changing Gradle version to 6.0.1 (looks like this is the latest at the moment), and it didn't help.
I also have my device selected at the top:
How can I make Android Studio install and launch the app on my device?
Android Studio version: 3.5.3
Edit:
I'm seeing the same behavior on an Emulator. I opened AVD from Android Studio and chose Pixel 3A. The emulator opens up, I run the app, nothing happens on the emulator (and I see the same Build Output messages).
The same happens to me. It is probably a bug in Android Studio. At the second compilation the app installs correctly. It is tedious.
There isn't enough information to find the cause of this issue.
But since it works with adb, it means you run adb command. There could be only one instance of adb daemon running. So if it's involved externally my guess is Android Studio won't have access to it.
Possibly try adb kill-server and running again from Android Studio and see if that helps.
I encountered the same problem, which I solved by checking the running devices. The connected phone had 2 accounts (might be personal & work) which was listed on the list of devices, so I had to select the second option, and it ran successfully on my phone. see the attached image.
One thing it might be:
Enable usb debugging
Settings
System
Developer options
Turn the setting on for usb debugging
If it does not appear go to settings about phone. Then click on build number like 7-10 times and it will enable you to have the developer options appear.

Cannot Install ARCore on Android Emulator

I understand this question has been asked a few times, however the solutions for the other users have not resolved my issue. I am attempting to install ARCore on my Android Studio emulator. The Play Store says "Your device isn't compatible with this version," and when I click and drag the ARCore for emulator APK to manually install it on the emulator, it gives me the following message: "The APK failed to install. Error: Could not parse error string"
The System Image I'm using: Oreo/ API Version 27/ABI x86/Android 8.1 (Google Play)
I have set the OpenGL ES API level to Render Maximum, and its version is showing up as OpenGL ES 3.1.
I have tried every solution I could find on here and have had no luck. Has anyone else had this issue or can you offer any suggestions?
If your smartphone doesn't support ARCore or you have no phone but need to debug an AR app – Android emulator is a great way to do it.
Follow these steps to install Android Virtual Device (AVD):
Make sure Android Debug Bridge (adb) is installed and works properly.
Download the latest ARCore_emulator.apk from GitHub.
Choose AVD using menu Tools > AVD Manager and run it.
Type this command in Terminal while the virtual device is running:
adb install -r ARCore_1.8.0.x86_for_emulator.apk
Repeat previous steps for additional AVDs you’d like to use on port 5554.
If you need more detailed information, please read THIS POST.
Followed Andy's Answer as follows:
Make sure adb is installed by typing adb at any terminal. *
1) Downloaded Google_Play_Services_for_AR_1.14_x86_for_emulator.apk from Android SDK Google Services (download it from latest release)
2) Copied this ***_x86_for_emulator.apk to the project root folder
3) Create new or Edit/Update existing Emulator with the instructions on the docs: How to create an Emulator with ARCore Support
i.e you must have emulators settings done.
4) Run the emulator
5) Open the terminal at Project Root (or anywhere you copied the ***_x86_for_emulator.apk file) and execute:
adb install -r Google_Play_Services_for_AR_1.14_x86_for_emulator.apk or
adb install -r <name_x86_for_emulator>.apk
5) Now run the project on same emulator. You can update rest of the emulators with these steps, providing that they have settings as given in Step 3.

Android studio: Error while installing apk

When I launch my virtual device ,it launches but my app doesn't show in AVD.
I update all the plugins and platforms required..after some time android studio given this error as following : Error while installing apk.
Please, solve my problem why this is happening, I'm suffering from 2 days.:(
Make sure your emulator up and running.
Also you can try running it on to your phone the process is simple,
Go to android setting=>About=>Click on build varian 7 times to become developer.
2.go to developer section and enable the debugging mode.
3.now if you are on window pc you have to download google usb driver and for MAC you can directly connect and you are good to go.
Make sure that you should uninstall all the applications that were developed by you in the emulator. After uninstalling all the applications that were build by you in the emulator, then clean project, run it again.Let me know if this works out.
Have you tried increasing the adb connection time out on the AVD?
To test this, first launch the avd and make sure it is turned on and running. Then try to build your application and install the .apk onto the device.

Can't upload app to virtual device

Installation failed since the device possibly has stale dexed jars that don't match the current version (dexopt error).
In order to proceed, you have to uninstall the existing application.
WARNING: Uninstalling will remove the application data!
Do you want to uninstall the existing application?
That's the pop-up I get when I try to run my app on the GenyMotion virtual device.
Installing com.example.engineering.app
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.example.engineering.app"
pkg: /data/local/tmp/com.example.engineering.app
Failure [INSTALL_FAILED_DEXOPT]
That's the console error message.
The odd thing is that even with a new clean "hello world" project I get the same error. It was working perfectly fine before I updated Android Studio. Something screwed up and I'm not sure what.
I've no idea what to do. I doubt it's GenyMotion related but who knows. I tried emulating a new device and reinstalling.
I presume you are running on API10 emulator. I also presume that you have tried removing the app yourself before trying to reinstall it. You are probably hitting 64k methods limit. Try running in say API19 emulator to see if you have the same issue.

install fails on emulator due to inconsiatant certificates

I have been doing some changes into the default ICS launcher2 . When I install it on a device it works fine. But when i try to install on emulator it gives me following error
Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]
I know that it happens because of the conflict between certificate of previously installed laucher on the emulator & the one i am trying to install. I also changed the package name & tried.That also works on device but not emulator.
Thank you.

Categories

Resources