Error - [INSTALL_FAILED_DEXOPT]

Frogger

Member
Licensed User
Longtime User
I've just installed Basic4Android (full) and I've started to play - looks good!
However I've just tried your "Hello World" tutorial but when I press F5, I get the following error:-

B4X:
pkg: /data/local/tmp/result.apk
Failure [INSTALL_FAILED_DEXOPT]

Restarting ADB Server may solve this problem.
Tools - Restart ADB Server.   Device serial: emulator-5554

I've tried restarting the ADB server but it doesn't help :(

Any ideas?
 

Frogger

Member
Licensed User
Longtime User
Can you post the complete text in the compilation window?

Sure, it's:-

B4X:
Compiling code.                         0.03
Generating R file.                      0.01
Compiling generated Java code.          2.86
Convert byte code - optimized dex.      0.74
Packaging files.                        1.21
Signing package file (debug key).       1.46
ZipAlign file.                          0.38
Installing file to device.              Error
   pkg: /data/local/tmp/result.apk
Failure [INSTALL_FAILED_DEXOPT]

Restarting ADB Server may solve this problem.
Tools - Restart ADB Server.   Device serial: emulator-5554

Thanks!
 
Upvote 0

Frogger

Member
Licensed User
Longtime User
I've encountered this error after doing many reinstalls. It was related to a bug in Android OS that doesn't frees files handles in some cases. It was solved by doing two reboots in a row.
Did you just create the emulator? What is the emulator SDK version?

Ok, I deleted the emulator and made another one. Tried again and installing to the device timed out. Then I tried again straight away (without restarting the ADB server) and it worked! The emulator SDK I'm using is 2.2 API 8, Rev 2.

Strange?
 
Upvote 0

mfstuart

Active Member
Licensed User
Longtime User
Hi,
I'm getting this error as well.
I've tried the twice reboot. After reboot, I then waited for the emulator to load completely. I used the Task Manager to see when it stopped counting up the Mem Usage.

Recreated the AVD again and restarted the ADB Server, but still get the error.

Here's my compile text:
==============
Compiling code. 0.00
Generating R file. 0.00
Compiling generated Java code. 7.58
Convert byte code - optimized dex. 0.59
Packaging files. 0.33
Signing package file (debug key). 0.48
ZipAlign file. 0.02
Installing file to device. Error
pkg: /data/local/tmp/ListView.apk
Failure [INSTALL_FAILED_DEXOPT]

Restarting ADB Server may solve this problem.
Tools - Restart ADB Server. Device serial: emulator-5554
===============

How do I get this error resolved?

I'm using the Trial Version and building the ListView example.

WinXP SP3
The AVD Target is: Android 2.2 - API Level 8
BTW, I had to copy the Android "platform-tools" sub folder into the "android-8" folder. I then renamed it to "tools". The folder was missing after installation. Is this the correct thing to do here?

Regards,
Mark Stuart
 
Upvote 0

mfstuart

Active Member
Licensed User
Longtime User
Do you have access to a real device?

Yes I do. It's an HTC Incredible, running version 2.2.
Why's that?

Can't I launch the project to an emulator instead of my real device. I'm not yet prepared to crash my device. :(

So what can/must I do?

Regards,
Mark Stuart
 
Upvote 0

TOB

Member
Licensed User
Longtime User
I have enabled 'Can Install To External Storage' and have a small 15M "SDcard". Process Timeout is set to 300 sec.

When I start the monitor I always check 'wipe user data'. I haven't had install-errors for a long time since using this approach.
 
Upvote 0

mfstuart

Active Member
Licensed User
Longtime User
Hi TOB,
I'm not sure if you are replying to my post or what.
If you are, I can't find all but one of the settings you reference.

I moved the Android folder out of the "C:\Program Files\..." folder to the root of another drive. That got rid of the invalid path error.

But still can't get rid of the following error:
========================

Compiling code. 0.00
Generating R file. 0.00
Compiling generated Java code. 1.22
Convert byte code - optimized dex. 0.58
Packaging files. 0.31
Signing package file (debug key). 0.47
ZipAlign file. 0.03
Installing file to device. Error
pkg: /data/local/tmp/ListView.apk
Failure [INSTALL_FAILED_DEXOPT]

Restarting ADB Server may solve this problem.
Tools - Restart ADB Server. Device serial: emulator-5554
=======================

I've restarted the ADB Server many times without getting past the error.
BTW: what is the path to the pkg: /data/local/tmp/ListView.apk file?
Can't find it.

Does anybody have any ideas what's causing this error and how to resolve it?
I'd consider buying the full product (still on Trial version), but if I can't get past spending a lot of time trying to set the environment up, then it's not worth all this time.

Regards,
Mark Stuart
 
Upvote 0
Top