Status Update
Comments
be...@google.com <be...@google.com> #2
If you can provide a test project that shows this behavior, that will help us pinpoint the problem faster.
ty...@gmail.com <ty...@gmail.com> #3
here is an example project.
Basically all I did was create a new project and copy what my build.gradle was from my real project. This one however does build faster but it is just a bare bones project with no resources.
This example project builds in 15 seconds without jack enabled and with jack enabled it builds in about 6-7 minutes.
I think it may be due to having an App Engine module in the project since I tried building before without it and it didnt take long to build even with jack enabled
https://github.com/tyczj/example
Basically all I did was create a new project and copy what my build.gradle was from my real project. This one however does build faster but it is just a bare bones project with no resources.
This example project builds in 15 seconds without jack enabled and with jack enabled it builds in about 6-7 minutes.
I think it may be due to having an App Engine module in the project since I tried building before without it and it didnt take long to build even with jack enabled
be...@google.com <be...@google.com> #4
Thanks, I can reproduce it with that project. It also showed a problem parsing a proguard config file.
Doing a Build->Clean and then Make Project
javac Debug build - ~2 seconds
Jack Debug build - 1 min 37 seconds
javac release build - ~1.4 seconds
Jack release build - fails with below error after 28 seconds
Error while parsing '/Users/bergstroml/AndroidStudioProjects/jack-tests/appengine-example/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-auth/8.4.0/proguard.txt':12
Try --help for help.
Warning: Exception while processing task java.io.IOException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2
:app:compileReleaseJavaWithJack FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileReleaseJavaWithJack'.
> java.io.IOException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2
Doing a Build->Clean and then Make Project
javac Debug build - ~2 seconds
Jack Debug build - 1 min 37 seconds
javac release build - ~1.4 seconds
Jack release build - fails with below error after 28 seconds
Error while parsing '/Users/bergstroml/AndroidStudioProjects/jack-tests/appengine-example/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-auth/8.4.0/proguard.txt':12
Try --help for help.
Warning: Exception while processing task java.io.IOException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2
:app:compileReleaseJavaWithJack FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileReleaseJavaWithJack'.
> java.io.IOException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_72.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2
fk...@gmail.com <fk...@gmail.com> #5
In my observation, compileReleaseJavaWithJack task consumed so many memories (and I met OutOfMemoryException...)
It took about 30 minutes in a terrible case.
So I added the following line to gradle.properties and it took about 2 minutes.
org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
It took about 30 minutes in a terrible case.
So I added the following line to gradle.properties and it took about 2 minutes.
org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
ch...@google.com <ch...@google.com> #7
2.2 performs much better with dependencies.
da...@gmail.com <da...@gmail.com> #8
Same issue with AS 2.2 Preview 4 on El Capitan.
ch...@google.com <ch...@google.com> #9
One of the main problem with Jack compilation is the memory pressure. I have added warnings if we found that the heap size is too small. If you find that Jack is still too slow in 2.2 and you have given Gradle at least 1.5Gb, please file another bug detailing your project setup (e.g. number of modules, dependencies) and what task is slow.
Please also add --profile when running the gradle build command and attach the profile report.
Please also add --profile when running the gradle build command and attach the profile report.
vo...@gmail.com <vo...@gmail.com> #10
Same here, Jack is taking too much time right now.
com.android.tools.build:gradle:2.2.2
Gradle 2.14.1
Java: 1.8.0_45-b14
org.gradle.jvmargs=-Xmx4608m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
Javac, Retrolambda, Apt:
Total time: 1 mins 15.77 secs
Jack:
Total time: 6 mins 23.866 secs
Profile look like this:
:transformClassesWithPreJackPackagedLibrariesForRelease 3m45.61s
:transformClassesWithPreJackRuntimeLibrariesForRelease 1m5.12s
:transformJackWithJackForRelease 1m1.23s
Subsequent build without any changes, takes more time than full build with javac:
Total time: 1 mins 14.444 secs
com.android.tools.build:gradle:2.2.2
Gradle 2.14.1
Java: 1.8.0_45-b14
org.gradle.jvmargs=-Xmx4608m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
Javac, Retrolambda, Apt:
Total time: 1 mins 15.77 secs
Jack:
Total time: 6 mins 23.866 secs
Profile look like this:
:transformClassesWithPreJackPackagedLibrariesForRelease 3m45.61s
:transformClassesWithPreJackRuntimeLibrariesForRelease 1m5.12s
:transformJackWithJackForRelease 1m1.23s
Subsequent build without any changes, takes more time than full build with javac:
Total time: 1 mins 14.444 secs
vu...@gmail.com <vu...@gmail.com> #11
I have the same problem.
From gradle installDebug -- profile report:
:app:transformClassesWithPreJackPackagedLibrariesForDebug 3m58.18s
:app:transformJackWithJackForDebug 2m28.60s
:app:mergeDebugResources 1m39.71s
:app:transformClassesWithPreJackRuntimeLibrariesForDebug 1m13.09s
I use Gradle 3.2.1.
My gradle.properties file (without comments):
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.configureondemand=true
From gradle installDebug -- profile report:
:app:transformClassesWithPreJackPackagedLibrariesForDebug 3m58.18s
:app:transformJackWithJackForDebug 2m28.60s
:app:mergeDebugResources 1m39.71s
:app:transformClassesWithPreJackRuntimeLibrariesForDebug 1m13.09s
I use Gradle 3.2.1.
My gradle.properties file (without comments):
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.configureondemand=true
ps...@gmail.com <ps...@gmail.com> #12
Same here. Clearly much slower than the old toolchain. I'm using DexGuard if it matters at all. I guess I'm switching back to the old toolchain and that retrolambda thing.
be...@google.com <be...@google.com> #13
We're aware that build times are an issue with Jack right now. We have improvements in the 2.4 Gradle plugin that should be a significant improvement for incremental builds.
mh...@gmail.com <mh...@gmail.com> #14
Man, why would I need to use retro lambda and jack compiler if this can slow up my build ?!
this is a critical issue that should be fixed!
this is a critical issue that should be fixed!
re...@gmail.com <re...@gmail.com> #15
Is recommended to use retrolambda instead of jack? It's really slow. I'm using Android Studio 2.3 and Gradle plugin 2.3.
ra...@gmail.com <ra...@gmail.com> #16
For me, just adding the Azure Mobile SDK and Facebook Login and AccountKit SDK makes the build time go to around 15-20 minutes on an average. Is it recommended to disable compilation with Jack for the time being
Description
supply all required information.
Studio Build: 2.1 Preview 1
Version of Gradle Plugin: 2.1
Version of Gradle: 2.1
Version of Java: 1.8.0 73 jdk
OS: OSX El Capitan 10.11.3
Steps to Reproduce:
just adding
jackOptions{
enabled true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
to my projects build.gradle file like described here
Then when I do Build/Rebuild or hit the Run button it takes about 10 minutes to finish building vs without jack it takes about 2 minutes to finish building.
I do have somewhat large number of dependencies, about 16 most being google play services and support library items