Unable install app into emulator 2.3.3 : INSTALL_FAILED_DEXOPT - android

I use the latest adt-bundle-windows-x86_64-20130717, with
Android SDK Tools - 22.0.4
Android SDK Platform-tools - 18
I had tried to install app on emulator 2.3.3, both for ARM and Intel. However, it no longer work (It used to work in my same Win64 machine before I'm using latest adt)
Installation error: INSTALL_FAILED_DEXOPT
Please check logcat output for more details.
Launch canceled!
My emulator setting is as follow.
I had followed how to solve INSTALL_FAILED_DEXOPT this error?. It doesn't help for my case.
Note that, emulator with 4.1.2 work extremely well for Intel. I even try to email the APK, and download -> install from emulator. But, this is what I'm getting Application not installed
Any workaround to overcome this problem?
My logcat is having such logging
E/PackageManager(855): Package org.yccheok.jstock.gui has mismatched uid: 10031 on disk, 10033 in settings
E/dalvikvm(1241): LinearAlloc exceeded capacity (5242880), last=468
E/dalvikvm(1241): VM aborting
E/installd(798): dexopt failed on '/data/dalvik-cache/data#app#org.yccheok.jstock.gui-1.apk#classes.dex' res = 11
Note, the problem will not occur, if I were using emulator 4.1.2

Most of the time associated with excessive values for LinearAlloc. Putting verbose mode for logcat could give you more details (can even pinpoint the problem). There no definite fix I heard of.Sometimes it can be fixed by wiping AVD, some get fix by increasing SD card only, some had to recreate new AVD, some fixed it by reinstalling ADT, there are lots of fixes people speak of, answer can be varied as actual problem.
Sometimes problem can be corrupted files, or application install entries which makes android confused whether app is installed or not. Or by use of complex libraries, or even problem with the compiler itself. There's not a lot of clear information on this error from Google, they say it is related to a bug in Android OS that doesn't frees files handles in some cases. However as looking to logcat it always connected to some dex files. and so as to DDMS and compiler.I suggest you to try all of the fixes I stated, also refer the given links
Issue 22586: Dexopt fails with "LinearAlloc exceeded" for deep interface hierarchies
Cleanup redundant interfaces from iftable to avoid excessive LinearAlloc use
Issue 42538: INSTALL_FAILED_DEXOPT solved by dex.disable.merger=true
If everything failed please put your verbose logcat

Try uninstalling your app before installing it again. It seems to have solved the issue for some according to this

I was facing the same issue after upgrading ADT and I was stuck for this issue for almost half and a day.After every HIT and TRY method found the solution.
**
ONE OF LIBRARY PROJECT BUILD TARGET WAS HIGHER THEN MY PROJECT , JUST
CHANGED LIBRARY PROJECT BUILD TARGET TO 3.0 AND MY PROJECT BUILD
TARGET TO 4.0.3 AND IT VANISHES.
**
Just posted my solution if it helps others in future.

It's very hard to find out what the error is from the information you provided.
Try the following
Clean your project
Uninstall your app
Download a different version of adt bundle
Experiment with different emulators with different values
Try to use a real device, does the problem still occur?
Look through these links, maybe your problem is similar:
http://blog.elsdoerfer.name/2009/05/25/android-fix-package-uid-mismatches/
How to solve Installation failed due to invalid APK file?
LinearAlloc exceeded capacity (5242880), last=1092 Error while installing on my Samsung Tablet Device
INSTALL_FAILED_DEXOPT error when trying to install application
Good luck!

Related

Android Studio AVD, CRASH, GRADLE PROBLEMS, cannot start up

The AVD fails to load, it doesn't recognise it. It asks me to run this manually, which I did via: "Run as Administrator" on android.bat found in the Android local, platform-tools folder.
I also did all the necessary SDK-platform and tools update for the relevant devices, etc. Still doesn't work.
I followed also a lot of 50 topics on Stack Overflow and Google bug
issue to find my solution to this. Still no luck.
I even clean project, rebuild project, deleted .gradle folder, tools folder, platform-tools folder to the point of uninstalling everything of Android Studio and their old caches.
Even with new Android Studio installation, I still cannot load up the AVD.
Before I did the whole complete uninstallation, yes I did kill the adb.exe many times via cmd and the rest of the lurking PID processes.
It was reported a bug in Android Studio 7 years ago and with everyone having solutions to this problem. I am still unable to fix this.
UPDATED 23.02.17 The issue still NOT resolved. Currently I am using another pc to do my development
More information
SDK_HOME = C:\Users\My Name\AppData\Local\Android\Sdk
Gradle version: 2.14.1
Android Plugin version 2.2.3
Workspace = C:\Users\My Name\MyProjects (Local, not version control or open source on cloud)
Source of download: https://developer.android.com/studio/index.html
Android Studio 64 bit 2.2.3 version
Laptop: 64 bit PC
Windows 10
Virtual Machines = Mac, Linux
UPDATED 25.02.17 Log specifically from .gradle assembleDebug log. (10 seconds after, standstill, left overnight and couldn't create a new project with NO CODE and couldn't load up Android Studio)
Looking in classpath from com.intellij.util.lang.UrlClassLoader#736e9adb for /com/sun/jna/win32-x86-64/jnidispatch.dll
Found library resource at jar:file:/C:/Program%20Files/Android/Android%20Studio/lib/jna.jar!/com/sun/jna/win32-x86-64/jnidispatch.dll
Trying C:\Users\User\.AndroidStudio2.2\system\tmp\jna8874909424579227886.dll
Found jnidispatch at C:\Users\User\.AndroidStudio2.2\system\tmp\jna8874909424579227886.dll
Looking for library 'user32'
Adding paths from jna.library.path: null
Trying user32.dll
Found library 'user32' at user32.dll
Loading library manifest C:\Users\User\AndroidStudioProjects\MyApplication2\app\src\main\nevercreated.xml
Merging main manifest C:\Users\User\AndroidStudioProjects\MyApplication2\app\src\main\AndroidManifest.xml
Merging library manifest C:\Users\User\AndroidStudioProjects\MyApplication2\app\src\main\nevercreated.xml
Merging manifest with lower nevercreated.xml:1:1-12:12
Merging applicati
on with lower nevercreated.xml:3:5-11:19
UPDATE 26/2/17 I did a chkdsk /f /r /x check and no bad sectors were found in the hard drive, to ensure that read and write or hard drive issues were the cause of the problem. No issues with the hard drive to affect this issue.
JDK was also reinstalled to ensure that the JDK was not hindering the problem. No firewalls or firewall programs were enabled, all of them were disabled and uninstalled. No problem even with firewall on for many months before too, so this is not a concern.
All processes were indeed TASKKILL before any other processes would occur. Still no luck.
UPDATE 27.2.17 I ordered a new SSD to arrive tomorrow and I will make a new installation (dual-boot) Linux and Windows 10 and install Android Studio on both systems to see whether it will work or not. So I took the extreme measure to have uninstall and reinstalled the program, no luck, the operating system, no luck and now I will test on a new hard drive soon. (FINGERS CROSS). Even though there is no bad sectors or error on this hard drive through checking the logs.
UPDATE 28.2.17 I reinstalled the whole operating system and I bought another new SDD. The Android Studio problem is solved.
REFLECTION
I reinstalled operating system before, but still had Android Studio problems. This leads me to think that it is a hard drive issue, an internet connection (firewall) issue OR Android Studio bug issue.
Unfortunately, I cannot pin point what caused my problem. It randomly happened out of no where. BUT I hope this will provide comfort to those who experienced almost 10 days of gruelling annoyance.

"There is not enough storage space on the device to store package" when starting Android emulator

I have just updated Xamarin in Visual Studio 2015 (it was a suggested update from Visual Studio).
After the update, when I start debugging with the emulator AVD_GalaxyNexus_ToolsForApacheCordova (Android 4.4 - API 19), the following error occurs:
The "InstallPackageAssemblies" task failed unexpectedly.
System.AggregateException: One or more errors occurred. ---> Xamarin.AndroidTools.AndroidDeploymentException: InternalError ---> Mono.AndroidTools.InsufficientSpaceException: There is not enough storage space on the device to store package: /data/local/tmp/Mono.Android.Platform.ApiLevel_23.apk. Free up some space or use an SD card and try again.
This did not occur just minutes before the update, and the project remained untouched during the update. I am quite sure about that.
The Xamarin documentation has this error documented here, and says:
There is not enough storage space on the device to deploy the package
This occurs when you don't start the emulator from within Visual Studio. When starting the emulator outside of Visual Studio, you need to pass the -partition-size 512 options, e.g.
emulator -partition-size 512 -avd MonoDroid
But I did start the emulator from within Visual Studio.
Check the internal storage size and available storage of your emulator. Default configuration is often not very large.
On MAC if your getting error make sure you increase your dataPartition to 1024M
disk.dataPartition.size : 1024M
On Mac current config: Feel free to add more bytes if you have a better potato(MacBook pro) than mine
Emulator memory issue
increase heap size ( make it 2*x).
in my case before it was 256 , then after i made it 512 , now its working fine.
posted by venkat Yanamandala
Cobus answer didn't help for me. Checking the device's storage, I saw that there should be more than enough space left to deploy my app. My only solution so far is to create new device in the emulator every time this happens. It keeps happening after I deployed my app several times (like 50+ deploys).
I just clean solution and rebuild again it.
I encountered with the same issue and managed to resolve it by simply uninstall the previous versions from ADB emulator. To uninstall:
.run the emulator.
.Drag&Drop the application's icon to the trash.
These following steps work for me
Increase Data diskpartition size 1024MB
Clean and rebuild again
I solved this question by cleaning the android system cache, there are several tools in the playstore for it, im my case i was debbuging with a attached device, so there was nothing to do with the emulator settings.

Unable to install apk using adb on device upgraded to Android Lollipop

I’ve recently upgraded one of my Android devices to Android Lollipop (5.0) and now I can’t debug my application and even install apk on the device using adb. I receive the following error
java.lang.UnsatisfiedLinkError: No implementation found for java.lang.String android.os.SystemProperties.native_get(java.lang.St
ring, java.lang.String) (tried Java_android_os_SystemProperties_native_1get and Java_android_os_SystemProperties_native_1get__Lj
ava_lang_String_2Ljava_lang_String_2)
at android.os.SystemProperties.native_get(Native Method)
at android.os.SystemProperties.get(SystemProperties.java:64)
at android.os.Environment.<clinit>(Environment.java:354)
at android.os.Environment.getLegacyExternalStorageDirectory(Environment.java:488)
at android.os.Debug.<clinit>(Debug.java:96)
at android.ddm.DdmHandleHello.handleHELO(DdmHandleHello.java:164)
at android.ddm.DdmHandleHello.handleChunk(DdmHandleHello.java:91)
at org.apache.harmony.dalvik.ddmc.DdmServer.dispatch(DdmServer.java:171)
java.lang.UnsatisfiedLinkError: android.os.Debug
at android.ddm.DdmHandleHello.handleFEAT(DdmHandleHello.java:176)
at android.ddm.DdmHandleHello.handleChunk(DdmHandleHello.java:93)
at org.apache.harmony.dalvik.ddmc.DdmServer.dispatch(DdmServer.java:171)
java.lang.UnsatisfiedLinkError: android.os.Debug
at android.ddm.DdmHandleProfiling.handleMPRQ(DdmHandleProfiling.java:187)
at android.ddm.DdmHandleProfiling.handleChunk(DdmHandleProfiling.java:88)
at org.apache.harmony.dalvik.ddmc.DdmServer.dispatch(DdmServer.java:171)
My device is Asus FonePad 7 ME175CG or K00Z
Kernel version
3.10.20-i386_cpt
android#mec9#1
Mon Apr 20 13:30:08 CST 2015
Is there any solution for this problem?
UPDATED
first of all thanks to those guys who pay attention to this very specific question, really thanks
for further clarification,
When I received this error, I googled the entire universe for the phrase java.lang.UnsatisfiedLinkError and gave a try to any solutions that seemed to be applicable, as well as, the solution that suggested by #Kushal and others. Most of the questions were (and still are) for HTC M8 and devices other than ASUS. If you visit this post, you may see an answer by me which is deleted by SO guards and I admit it that it was not really an answer and I post the answer while I was really disappointed of resolving the issue.
Anyway, what I've done up to now which may be helpful for others are,
First, I upgraded my Android SDK tools to the latest version 24.2. After that when I tried adb install demo.apk, in some cases it was successful and sometimes not. I killed all running apps on the device (as suggested by some guys) but it sometimes works and sometimes not.
Then, I gave a try to other solution, specifically the one that suggested by this post. In fact, when I try to debug the app using Intellij IDEA, the IDE itself does as the suggested procedure and the result is
You can see that the IDE itself does as the procedure by #Kushal suggests.
After that, I found several records (referring a few as) here and here and in latter someone has said that
This was a bug in some HTC devices that was fixed with L-MR1
Therefore I came up with the idea that there may be a fix by ASUS team which you guys know about it and kindly provide me with that.
Thanks
Disabling Tools -> Android -> Enable ADB Integration solved my issue.
Running on Asus Zenfone 2.
I don't know why this issue appears but you can successfully avoid this issue by closing all the running applications on your device.
Also Unable to test app after upgrading to Lollipop
This error message is due to release binary problem by manufecturer (Asus in this case). This error will not appear in Google Nexus and Samsung Galaxy due to their handling in binary
Solution :
After searching about above problem, the below solution is found on other Stack Overflow question :
Using terminal, just reinstall with adb to avoid the Android Studio recompile time:
$terminal: /sdk/platform-tools/adb install -r
And usually it works. If it fails again, just run this command again
If you really want to try it, the process would be:
Close Studio (or try disabling Tools | Android | Enable ADB Integration)
Do the following on a shell:
$ adb push /path/to/your/project/app/build/outputs/apk/app-debug.apk /data
$ adb shell pm install /data/app-debug.apk
$ (am start command from comment #4/#5)
Restart IDE (or Re-enable ADB Integration).
This solution is suggested by Google group for alternate fix to above problem Here
Reference Answer : Here
This way you will able to re-install apk and above error will not come
I found a solution though I am not sure if others are willing to use it as it may harm the device and causes it to get useless
In fact, as the answers that the question has received just sound to be copy and paste of other questions’ answers and are not applicable in my case I disappointingly tried to make a radical move and flash my device to downgrade its software to Android 4.2.2 but chancy I decided to flash my device to Android Lollipop again to see if it removes the issue and fluky it did (at least in my case)!
IMPORTANT NOTE!
Before following this procedure, consider the fact that your device may get broken and you lose all data you have on your device. So please make a backup copy before you proceed.
I searched a lot and found methods that are partially described here and here but finally I followed this procedure:
Download the correct update file from here (ASUS support or FonePad Support) according to the type of your device (ww, tw or others). Mine is ww and downloaded ASUS Fonepad 7 (ME175CG) Software Image Version: WW_V6.3.7 For WW.
Then change the downloaded file to ASUS_BUNDEL.ZIP
Then copy that file in to root internal memory
Putting the device into recovery mode (by holding volume up and
power key down simultaneously)
Choose SD Download
The device starts to flash and after finishing it you have a brand new device and the issue is completely removed.
Now I can install apk using adb command and debugging my application as I did before and I have not seen the nasty error anymore.
I'll open this answer to receive others feedback then I mark it as the real answer.
I hope this help others resolve the issue.
I had the same issue with Asus MemoPad ME70CX and solved by restarting ADB server using command line. Also you may need to kill BlueStacks processes running in background using TaskManager.

Error while installing application (INSTALL_FAILED_DEXOPT)

I am working with ccr4j API in Android so when I run my project its thrown an error like:
Error while installing application (INSTALL_FAILED_DEXOPT)
I find from net and same site also, did all trying like,
1. Uninstalled same application from device.
2. Run Emulator with Wipe User Data.
But still same error comes.
So anyone know why its thrown this kind of error?
This most likely has to do with the size of classes.dex. On anything pre-ICS dexopt will fail on anything over 5mb. Check the size of classes.dex in your apk. It would also be good to see what your method count is as dex has a 65536 method/field limit.
I have same problem. Checked classes.dex file and it is about 7mb's. I'll try to find a solution. I hope Facebook's solution solves mine too.
By the way thanks for information #Jared.
https://www.facebook.com/notes/facebook-engineering/under-the-hood-dalvik-patch-for-facebook-for-android/10151345597798920
Edit 1: I've solved this problem by using proguard optimization. My previous classes.dex file was about 7mb, and after proguard optimization it became 4mb. And now I can run this obfuscated and optimized apk on 2.2 and 2.3 devices.
Edit 2: Official Google Multi Dex support is the best solution for this issue. https://developer.android.com/tools/building/multidex.html
Find Android SDK folder. (Usually C:\User\AppData\Local\Android\sdk) Delete folders which starts with dot(.), they are temporary downloads files. Then delete Android Emulator from SDK Manager. Then run Android Studio as administrator and then download and install Android Emulator again. And make sure you have installed Intel H.A.X.M.. Now you can create emulator and use it without errors.

"createRenderThread failed to connect" when starting an Android Virtual Device

Can anyone tell me how to resolve the following issue, or what tools may be available for me to try to resolve this. I get this error when I try to start a Jelly Bean VM.
Starting emulator for AVD 'Nexus_7'
createRenderThread failed to connect
Failed to allocate memory: 8
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
I've tried executing it from the command line as:
C:\Program Files (x86)\Android\android-sdk\tools>emulator -avd Nexus_7 -memory 1024
And still no-go. I can't see any way to get more detailed information. And I really don't know where the 8 comes from from memory allocation.
Here's my virtual device set-up:
Any help is appreciated.
In my case this was caused by blocking some of the traffic/ports in my firewall.
It appears that this message is shown also when the emulator can not be reached (e.g. by Eclipse). When this is the case, the following happens:
the message (create render thread failed to connect) appears also while starting the emulator from AVD
Eclipse does not 'see' running emulators and starts a new one for each run of the program
Eclipse never manages to load apk into the emulator
I believe this post can help you to solve this issue. Just download tools_r19-windows.zip zip file and replace the tools folder in your sdk with the one provided in the zip file. Later when you launch Eclipse, ignore the ADT version warning message and you are good to go.
I also had the same issue and this technique helped me to solve the problem.

Categories

Resources