Questions tagged [dexopt]

The Android system tool for Optimizing and Verifying applications

The Android system comes with an Optimizer and Verifier for applications. This tool is called dexopt. Its primary task is to verify the dalvik bytecode of applications and optimize the bytecode for efficient execution. Dexopt is a native program which uses libdex / dvm [1] in order to parse the dex file and interpret the dalvik bytecode. It will be called for every application when it gets installed on an Android device. If the verification fails the application gets rejected and will not be installed on the device. After the applications has been verified dexopt generates an optimized version of it. This will be stored for later execution in the dalvik-cache directory. These two steps will also be executed when the devices boots up for all applications which haven't been optimized before.

The verification is not a security feature in the first place! It is easy to circumvent most parts of it where it is not recommended for application developers to do so. Dexopt checks the dex file structure and does a detailed bytecode analysis. By this the installation process can reject broken applications early before they can be executed. The verification of the bytecode has another very important advantage. The optimizing engine can assume much stricter preconditions on the bytecode, which results in better optimization.

At the moment we are more interested in the dalvik bytecode analysis/optimization. Dexopt analyzes all methods for all classes within the dex file. This will be done by a linear sweep algorithm which iterates over the bytecode. For each instruction different checks/optimization steps will be executed.

15 questions
49
votes
2 answers

Difference between dexopt and dex2oat?

Google is moving from Dalvik to ART(Android Runtime). I was trying to understand, how it is going to improve the performance. The best explanation I found is the below image: One of the main component which has changed is dexopt to dex2oat. Since I…
Gokul Nath KP
  • 13,135
  • 24
  • 77
  • 112
33
votes
8 answers

installation failed since the device possibly has stale dexed jars that don't match the current version (dexopt error)

I am unable to run app from android studio to my samsumg phone running android 2.3.6. I am getting Application installation Failed popup refer below screenshot. when I click on OK I get below error in log Failure [INSTALL_FAILED_DEXOPT] DEVICE…
18
votes
4 answers

Package has mismatched uid: 10124 on disk, 10134 in settings

I have some problems on Android 2.3.X devices for one of my apps (package name is com.netbiscuits.kicker). However I can not install my APK. I have tried to install it directly from eclipse (debug keystore) with the following message in…
sockeqwe
  • 14,614
  • 22
  • 78
  • 136
12
votes
2 answers

LinearAlloc exceeded capacity (5242880), last=1092 Error while installing on my Samsung Tablet Device

Am continuously getting, this errors in logcat DexOpt: not resolving ambiguous class 'Lorg/apache/http/client/utils/URLEncodedUtils;' 12-07 05:26:01.085: ERROR/dalvikvm(4620): LinearAlloc exceeded capacity (5242880), last=1092 12-07…
Udaykiran
  • 5,705
  • 9
  • 41
  • 75
10
votes
2 answers

Running apps containing large amount of code

Background It seems some old Android OSs (and maybe even the newest ones) have a limitation on the amount of code each app can hold. As I've found, the limitation is on a buffer called "LinearAlloc" . On 2.2 or 2.3 it's about 5-8 MB , and I think…
android developer
  • 106,412
  • 122
  • 641
  • 1,128
9
votes
2 answers

Dexopt failed on a very big APK (Out-of-order method_idx) when dex.force.jumbo=true

I have a very big Android project with a multiple, big, 3rd party jars (as Android Libraries). I believe I've hit a Dex's max number of method limitation (compiling via eclipse): [2012-11-18 02:28:45 - Find In Files] Dx processing classes.dex... …
Gili Nachum
  • 3,982
  • 2
  • 27
  • 29
9
votes
1 answer

What is dexopt ? ( Android Shell Command )

What does the Android shell command dexopt ? Where can i find a manual ?
droiduser
  • 91
  • 1
  • 1
  • 2
5
votes
0 answers

DexOpt: Illegal method access

I have a location based app which worked fine till yesterday but when I run it on my phone now it acts weird. Below is my logcat which shows up errors that I've never seen or heard before 07-07 14:17:25.548: D/ActivityThread(24383):…
Vinay Potluri
  • 525
  • 1
  • 7
  • 23
3
votes
1 answer

Android compiler, architecture and runtime, how doeas it work together?

I am studying Android runtime recently, especially focusing on dex2oat tool which is the heart. However dex2oat is not isolated but works together with Android's boot-image, android-root, instruction-set, runtime-arg etc. Can anyone explain what…
Harvey Dent
  • 197
  • 1
  • 11
1
vote
0 answers

How To Get Log Cat for INSTALL_FAIL_DEXOPT?

I am receiving a "App did not install" message when I try to install, on a physical device, an APK that is being generated from Eclipse. (I know Eclipse is old, this what I have to use right now) I am able to run directly from Eclipse to my device,…
Chris
  • 5,199
  • 15
  • 61
  • 124
1
vote
0 answers

Dexopt error on Android tablet devidce

I try to run my Android project on my Tablet "Samsung GT-P1000" device but, any time I try to run the App I get this massage. And at the Logcat: pkg: /data/local/tmp/com.helloworld Failure [INSTALL_FAILED_DEXOPT] I saw many answer here but…
Stefan Maimon
  • 223
  • 3
  • 12
0
votes
1 answer

how to limit the first dex size while building android app by using multi-dex

First,I face this problem: Conversion to Dalvik format failed:Unable toexecute dex: method ID not in [0, 0xffff]: 65536 so,I try to division the dex provided by Google.refer Building Apps with Over 65K Methods And I unPack the apk,it really …
danny
  • 1
0
votes
2 answers

Solving install error dexopt

Even though there are several posts about dexopt errors none of them helped. I suddenly started to receive dexopt errors : Failure [INSTALL_FAILED_DEXOPT]. Ive tried uninstalling the app from my phone but it didnt help. Ive tried to wipe app data…
0
votes
1 answer

Invalid name: 'enum constant initialization$2' while installing app

While installing android app from eclipse to any emulator I start getting error: 04-17 00:36:53.043: E/dalvikvm(20216): Invalid name: ' enum constant initialization$2' 04-17 00:36:53.043: E/dalvikvm(20216): Trouble with item 10075 @ offset…
Danilo C.
  • 194
  • 2
  • 11
-1
votes
1 answer

Unable to run app on device using android studio

I have been trying to use android studio and every time I deploy an app on a device, it gives me an error saying: Installation failed since the device possibly has stale dexed jars that don't match the current version (dexopt error). In order to…