Questions tagged [dex]

.dex files are compiled Android application code files.

Android programs are compiled into .dex (Dalvik Executable) files, which are in turn zipped into a single .apk file on the device. .dex files can be created by automatically translating compiled applications written in the Java programming language.

867 questions
18
votes
4 answers

Check how many methods you have in Android Studio

It looks like I'm flirting with the dex limit of 65K, if I write some new methods I have a dex error, if I remove some older things, it's gone. Is there a way to check how many methods you are using at the moment in Android Studio?
TomCB
  • 3,983
  • 9
  • 40
  • 66
18
votes
6 answers

How to debug smali code of an android application?

I have a working android application. of which i dont have a source code. I would like to debug a functionality of this application. I could successfully reverse engineer this application apk file using apktool -…
18
votes
5 answers

Multiple dex files - Conversion to Dalvik format failed - Unable to execute dex

I have 2 app versions - pro and lite. They are both already on the market at v1.01. I am trying to release v1.1 for both. This update includes SwawrmConnect integration in order to use their global leaderboards. I should start off by saying I…
Matt
  • 3,882
  • 14
  • 46
  • 89
17
votes
1 answer

Android Jack mockito alternative

Maybe is too soon to ask, but as Jack and Jill was announced today I get very excited with it. I really want to go for it, but they also state: Various tools that read .class files (such as JaCoCo, Mockito, and some lint checks) are currently not…
Guilherme Torres Castro
  • 15,135
  • 7
  • 59
  • 96
17
votes
1 answer

Dynamically loading aar library

I'm trying to build a library and dynamically load it in another app in Android Studio using gradle. I understand how to create jars and turn them to dex files for loading. But when I build a library in Android Studio with Gradle - I don't get a…
shein
  • 1,834
  • 15
  • 23
16
votes
1 answer

Adding Google Guava to Android project - significantly slows down the build

After adding Google Guava r09 to our Android project the build time increased significantly, especially the DEX generation phase. I understand that DEX generation takes all our classes + all jars we depend on and translates them to DEX format. Guava…
AlexV
  • 3,836
  • 7
  • 31
  • 37
16
votes
4 answers

How to enable dex compiler D8(Next-generation Dex Compiler) in android studio

With the release of Android Studio 3.0 Beta release, the android studio provides next-generation dex compiler, D8 to compile code and build android APK. Currently, D8 is available for preview. Check more…
pRaNaY
  • 24,642
  • 24
  • 96
  • 146
16
votes
2 answers

Compiling Android project from command line is slow

I'm compiling my (fairly simple, just 5 files with few hundred LOC) app from command line on OSX using: ant debug It works. But it works slowly: BUILD SUCCESSFUL Total time: 26 seconds Why is that? It takes this much time even if I change only one…
mav
  • 1,230
  • 1
  • 15
  • 23
15
votes
3 answers

Get checksum of the source codes in Android library

I am developing an android library and I want to apply a tamper-detection mechanism to my code, since it calls some sensitive financial web services. What I'm going to implement is to calculate the checksum of the apk ( or important parts of it),…
Farhad
  • 12,178
  • 5
  • 32
  • 60
15
votes
2 answers

Why should I include a gradle dependency as `@aar`

Why should (or shouldnt) I include a gradle dependency as @aar, What are the benefits/drawbacks if any? As you can see I added @aar to the libraries below that supported it. But everything seemed to work before doing that as well... dependencies { …
Aksel Willgert
  • 11,367
  • 5
  • 53
  • 74
15
votes
2 answers

Load DEX file dynamically on Android 5.0

Prior to Android 5.0 I was able to load DEX files dynamically using DexClassLoader and calling loadClass() method but with the latest Android version I get a ClassNotFoundException. Here is what I am doing: Generate DEX…
garibay
  • 1,046
  • 1
  • 10
  • 12
15
votes
4 answers

Android support multidex library implementation

I have hit the magic dex limit because my application uses a lot of jars (drive API, greendao, text to pdf, support.. ). My current solution was that I literally created a second apk just for google drive which I called from the main apk. But now I…
Tadej Vengust
  • 1,351
  • 4
  • 18
  • 35
14
votes
4 answers

How to put specific classes into main DEX file?

We found an issue on Amazon market that IAP doesn't work if it's receivers located not in main DEX file. The question is how to force gradle to put specific classes (receivers) into main DEX file. Here are the gradle DEX settings: afterEvaluate { …
Taras
  • 2,526
  • 3
  • 33
  • 63
14
votes
8 answers

Android Studio: Error:Execution failed for task ':app:dexDebug'

I'm using Android Studio for the first time and I got the following error after importing the project (previously it was an eclipse project where I had issues too.) Here is the information given: Error:Execution failed for task ':app:dexDebug'. >…
dephinera
  • 3,703
  • 11
  • 41
  • 75
14
votes
3 answers

How to avoid 65k method limit while using Google Play Services

If you find yourself writing a big Android application that depends on many different libraries (which I would recommend instead of reinventing the wheel) it is very likely that you have already come across the 65k method limit of the Dalvik…