After several hours of fighting to get an older project imported from Eclipse to use Gradle and into Android Studio v0.1.3...what I've gotten to now is I can actually do the build on the command line, but when I do Build/Rebuild Project in Studio I get:
Gradle: FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring project ':EpicMix'. > Failed to notify project evaluation listener. > A problem occurred configuring project ':facebook'. > Failed to notify project evaluation listener. > java.lang.OutOfMemoryError: PermGen space
It's not a HUGE project, there's a few small sub-projects (including Facebook), so I don't think it really is memory. I just can't figure out what this is...
lang. OutOfMemoryError: PermGen Space is a runtime error in Java which occurs when the permanent generation (PermGen) area in memory is exhausted. The PermGen area of the Java heap is used to store metadata such as class declarations, methods and object arrays.
If you haven't yet encountered an OOM in your Android application, you will in the near future. Memory leaks cause the OutOfMemoryError in Android. To eliminate the OutOfMemoryError, you must first eliminate memory leaks from your Android application. The Error!
OutOfMemoryError issues occur either in the compile phase of your project or the test phase of your project while building your Gradle project. If the error occurs during compilation, you must increase heap size thus according to your system capacity and use the following lines of code in Linux and Windows.
For those of you running gradle from the command line, create a gradle.properties file, put it in the root of your project, and add the following:
org.gradle.jvmargs=-XX:MaxPermSize=512m
The size of the PermGen space can be increased within Android Studio under File > Settings > Compiler. Look for the setting named "Additional compiler process VM options". Just add the following parameter:
-XX:MaxPermSize=512M
The default value is 92M. Use G if you want to specify a value in gigabytes.
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