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.
Related
I was testing the new version of Ionic framework with Capacitor as I tried to build and run my app on emulator and my device I faced this error without success in installing app
No Compatible APKs found for the device.
after lots of search and struggling to fix this and lots of fails, as I was talking to one of my friends about it I realised maybe this is related to build configuration.
as I could not find similar anywhere I decided to share the answer here maybe helps and save someone time.
No Compatible APKs found for the device.
This error appears to your Build Output when android studio cannot find the related APK file generated, so by a simple change in your buid configuration you can fix this, in my case I fixed the problem like this:
thorugh this section select:
Edit Configuration
default Deploy option under Installation option is set to
APK from app bundle
by changing it to
Default APK
you'll be able to build and run your app successfully.
I hope it help you to run your shiny app asap ;p
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!
I have followed the instuctions as posted on http://source.android.com/source/index.html to build an Android Source Environment. I am using Ubuntu 10.04. The process went without problems. After hours of downloading the Source Tree (I Have tried several including 2.1 and 4.0.1) and execution of the make command all image files were created in the directory '/WORKING_DIRECTORY/out/target/product/generic' except the boot.img file. I read across the internet that it is possible to create an own boot.img file using 'mkbootimg'. However I would like to avoid this in first place and use this option only as a last resort, because I am not familiar with the process as it requires some header files I am not certain of where to find them. I am curios why the boot.img file was not created.
Is somebody facing the same issue or maybe has solved the issue?
Best Regards
You've built your image for an emulator. Thus, you not need an boot.img to run an emulator and that's why it is not in your directory. You should make build for a particular device. If this device is Google device you'll have no problems - just follow the instructions on the webpage: http://source.android.com/source/building-devices.html
I have Eclipse with Android set up. The problem is when ever I run a project from eclipse to test it, the application never launches and the emulator never shows up. Even though the launching progress bar shows 100%.
Make sure the AVD's memory is set to 512, if it's higher the emulator will get a memory heap error and fail. Also try to enable verbose output when building, this can be set from within the properties.
Do you have a device attached? Eclipse switches to mobile devices automatically
I had once or twice had such problem. Restart of eclipse worked for me. And Yes also check the Run configuration, make sure your project is linked with emulator.
Go to Window->Preferences->Android->Build and select verbose build output
Now run your project and check Android console. In my case there were thousands of
"Dx processing %classname%..." which took several minutes to finish.
Just to make it clear: dx.bat is an ADT utility program, it converts multiple Java class-files to single "classes.dex" file(Dalvik executable file).
I had a project which used several libraries with lot of classes and the compilation was very fast(several seconds), but the launching was quite slow(2-4 minutes).
Then I found out that the most time consuming part was converting class files from my project and from all third-party libraries to *.dex file(the resulting size of dex-file was about 4 Mb). As far as I know, it's impossible to attach libraries to android project without dexing their class-files, so you have to be patient during launching your project.
UPD: It's possible to strip all unused code from your application.
Please check this link: Always running proguard before Android dex'ing in Eclipse
Whenever I switch to DDMS view and start method profiling, I get the following error message when I stop profiling:
Method Profiling Error:
Unable to download trace file:
Remote object doesn't exist!
This only happens with 1.6 and 2.1 AVDs, 2.2 and 2.3 work fine. I've been having this problem ever since the latest update to the Eclipse Android plugin. I'm using Eclipse 3.5.2 on Ubuntu 10.04 with Android Development Toolkit version 8.0.0.v201011171904-77661. Let me know if you need any more information.
Edit 1:
Logcat output
Edit 2:
The trace file is actually created on the sdcard and I can pull it with adb or from DDMS file explorer and view it in traceview. I just get the error message when I click on the "stop method profiling" icon and the trace file isn't automatically displayed. I tried deleting the AVDs and creating new ones, installing the latest plugin version, and reinstalling the plugin but the issue remains. I can live with it, but it'd be nice to get it working like it used to.
I've read that this method of profiling works only on Android 2.2 and higher. Sorry, can't find link now.
On lower versions you are still able profile via Debug.startMethodTracing(); ... Debug.stopMethodTracing();
Upd: check that you have properly mounted sdcard with read/write permissions and check that you have WRITE_EXTERNAL_STORAGE permission in your manifest file. May be problem in this, because beginning from Android 2.2 DDMS heap dump requests streaming directly out of the VM, removing the external storage requirement.
If you have all permissions, then post here logcat output please.
P.S. I've found a document that I mentioned.
I would check if you can download the file manually with adb pull for starters. At least them you know if there is a problem with the file access and you can also look at it with traceview externally.
In addition you might want to check if there is a bug regarding this feature and/or try the latest release available from aosp since the latest Android tools seem to have issues for a lot of developers.
Of course a clean reinstall or an install of an older version would also help you finding the problem potentially.