Compiling Jars and adding them to your Android project

Well, that’s what, I invested days in it, looked for the whole database, so either I didn’t look for the right words, or there is no answer to it, I hope, “bye”.

Symptoms: Compiling the Android DX project will compile all the banks every time the project is built - there is no reason for this, once should be enough, any how it does it every time, each assembly can take a lot of time, and not take seconds min.

The real problem:

-Adding several cans causes the eclipse to fail - now it is with these settings (heavy cans) -Xms256m -Xmx1024m -XX: + UseParallelGC -XX: PermSize = 256M -XX: MaxPermSize = 512M

(which actually gives better performance, so if your eclipse compiles slower, you can add -XX: + UseParallelGC this will help) (I could not set it to anything higher, the java heap size is up to 750 m, when eclipse fails, gc does not work, while DX compiles the jar, it tries between them, but the processor is busy, which does not allow it, therefore, when it gets to the fourth fifth jars that have 3 MB, it has something kind of like 600 MB on the heap, which is why I used gcoverheadlimit)

Compiling each of them or several of them together will compile it well (within the same Android project), the problem is that I can not find a way to compile them separately (then I will need apks installed on the client device) and when I compile them together Eclipse crash.

, cmd DX, , eclispe, , , , DEX, didn .

java, , gcoverheadlimit, , - /, /...

: java Dalvik, , , , Dalvik, .

+3
3

, , , , , .

: , : : opcode == null, Dalvik 2.

: DX , 16 , ( , ) .

: Android APK.

Android ( , ): arraylist , classes.dex, APK / , , , , , Android, ?

: , , , , eclipse , "opcode == null", , , .

+2

JAR , JAR...

Eclipse "" → "", " Java". "", " JAR...", .

0

. "Dx processing..." , classes.dex 3-4 (3,4 ). , . , JVM eclipse (eclipse.ini). BTW, stackoverflow 100 .

, eclipse.ini :

    CompileThreshold=5

I deleted this line, and now compilation takes ~ 10 seconds !!! Also, now I am using ParallelGC instead of G1GC in the eclipse configuration, because it is more stable and does not break my IDE.

So, your main task is to review your eclipse.ini and get rid of all suspicious and experimental parameters.

0
source

All Articles