I try to migrate from Java 7 to Java 8, so I have install the new sdk for Android N and all tools. I follow the developper guide to use Java 8 in android studio, but when i try to compile apk, I have an infinite Gradle Build Running.. I already try to restart Android Studio, but after 1 hour, the Gradle Build Running it's not finished. In the Windows task manager I see the process java.exe take a lot of memory and CPU was at 90%.
Someone already encountered this problem ?
Thanks.
Edit:
I have the following versions :
Java version : 1.8.0_92
Gradle version : 2.1.2
Android Studio version : 2.1.2
compileSdkVersion : 24
buildToolsVersion : 24
targetSdkVersion : 24
Edit2:
I tried with Android Studio 2.2 and 5 minutes after starting the build, I have this error :
Error:Execution failed for task ':app:compileProductionDebugJavaWithJack'.
> java.lang.RuntimeException: java.lang.OutOfMemoryError: GC overhead limit exceeded
add these lines to your gradle.properties file
org.gradle.java.home=/Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home //edit this according to your java home path
org.gradle.daemon=true
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.parallel=true
org.gradle.configureondemand=true
When you run Android Studio for the first time, it will download some initial plugins and the delay depends on the internet connection speed and some other things. But you may want to run the IDE in offline mode. To do so, go to File -> Settings and then 'Build, Execution, Deployment' -> 'Build Tools' -> 'Gradle' and enable 'Offline work' checkbox.
Sorry, I couldn't comment this because of low reputation :D
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With