« Back to Cius Developer Questions

Error while installing application (INSTALL_FAILED_DEXOPT)

Combination View Flat View Tree View
Threads [ Previous | Next ]
Hi all
 
We have a problem while installing/debugging an application via adb over USB. When we try to install the application with ADB, we get
 
pkg: /data/local/tmp/connectgb.apk
Failure [INSTALL_FAILED_DEXOPT]
 
 
When we run the application via eclipse, we get same errors with log details shown below:
 
12-22 11:49:19.674: I/dalvikvm(18453): dexopt failed with NCG! Fall back to regular dexopt
12-22 11:49:19.674: E/dalvikvm(18453): DexOptZ: new cache file '/data/app/com.connectgb-1.apk' is not empty
12-22 11:49:19.678: W/installd(12513): DexInv: --- END '/data/app/com.connectgb-1.apk' --- status=0xff00, process failed
12-22 11:49:19.678: E/installd(12513): dexopt failed on '/data/dalvik-cache/data@app@com.connectgb-1.apk@classes.dex' res = 65280
12-22 11:49:19.682: W/PackageManager(26790): Package couldn't be installed in /data/app/com.connectgb-1.apk
12-22 11:49:19.818: D/dalvikvm(26790): GC_EXPLICIT freed 12306 objects / 657544 bytes in 133ms
 
 
We also get same errors on cius emulator also.
 
Any ideas?
 
Thanks

There's not a lot of clear information on this error from Google (error in the dex file optimization process.)  There seem to be quite a few folks on the web that have encountered it...reading some of these the common thread appears to be stale files or app install entries that cause Android to think the app is in partially installed/uninstalled state.
 
Some suggestions:
 
Delete data, cache and any instances of connectgb or connectgb-1 apps in Manage Applications.
 
delete /system/sd/app/connectgb*

delete the directory /data/data/connectgb*
delete /data/app/com.connectgb*
edit /data/system/packages.xml removing all entry for connectgb*
 
ADB pull /data/data/com.android.vending/databases/assets.db to a computer,
then open it with a sqlite editing too. Look in the assets10 table for the
row where field package_name matches your apk name, update the field to 'UNINSTALLED'. Push the assets.db file back to its original location,
and reboot.
 
(Some or all of these may fail due to permissions on the Cius, advice gleaned from XDA forums here http://forum.xda-developers.com/showthread.php?t=580303)
 
Keep in mind it looks like both connectgb.apk and connectgb-1.apk may have gotten installed at some point.
 
If none of this helps, a factory reset (or Wipe Data in the emulator) should put everything back to original condition.

So after looking into your issue, I have a couple suggestions. First, if trying to install on an actual device, go to Settings -> Applications -> Manage applications and see if your application is listed there. Even if it says 0 bytes next to the app, it means that there are remnants of your application still on the device. Click on your application and click uninstall, and this should fix the problem. If you're on the emulator, try launching the emulator with the "Wipe User Data" box checked, which will accomplish wiping away any traces of your app on the emulator. Before you try installing your application after this, do a "build clean" on your application before trying to install it again.
 
If none of this works, from the command line run "aapt d badging <YOUR APK NAME>" and post the output. The aapt command should be in the same location as the adb command.
 
James Catalano
 

Hi all

Unfortunately none of these worked for me. I'd solved my problem by reinstalling Android sdk, Eclipse and cius emulator and also created a new project.

Thanks