Reputation: 127
I can't run or execute my code. I already followed this.
It still won't work. My error message
Error:Execution failed for task ':app:packageInstantRunResourcesDebug'. Java heap space ties file. For example, the following line, in the gradle.properties file, sets the maximum Java heap size to 1,024 MB: org.gradle.jvmargs=-Xmx1024m Read Gradle's configuration guide
Read about Java's heap size
I tried turning off the instant run and there's a new error
Error:Execution failed for task ':app:packageDebug'. Java heap space ect's gradle.properties file. For example, the following line, in the gradle.properties file, sets the maximum Java heap size to 1,024 MB: org.gradle.jvmargs=-Xmx1024m Read Gradle's configuration guide
Read about Java's heap size
EDIT: I found the reason why. It's because i added a code that'll unzip a 500 mb file and will transfer into the internal storage. It might be because it has a lot of files. The zipfile has 80,000+ files.
Upvotes: 0
Views: 4436
Reputation: 170
Today after java update , i have this issue Execution failed for task ':app:packageInstantRunResourcesDebug', when i run "gradlew build --stacktrace" console show me that in my java path C:\Program Files\Java**jre1.8.0_121**\lib , java can`t find tools.jar, perhaps after update java on my pc for some reason deleted this file, but fortunately i have another version of java on my pc C:\Program Files\Java**jdk1.8.0**_101 and i copy-past tools.jar from this location to my jre1.8.0 . Perhaps some one help this.
Upvotes: 0
Reputation: 1170
Possible reason of this error could be mismatch of JDK versions.Try to check your system Java Version with Your Studio's version.
java -version
should be similar to Android Studio File > Project Structure > JDK Location
version.
Upvotes: 0