0

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.

Community
  • 1
  • 1
Temmie
  • 127
  • 2
  • 14

2 Answers2

0

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.

Anurag
  • 1,162
  • 6
  • 20
  • how do i validate the version to my android studio? @Anurag Pandit – Temmie Nov 30 '16 at 12:31
  • In your terminal give above command "java -version" it will show you system's java version for example " java version "1.8.0_74" " and in your Project Settings below SDK location find JDK " it should be equivalent to system's version, example "java-8-oracle" . – Anurag Dec 01 '16 at 05:16
0

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.

Alexandro
  • 170
  • 3
  • 12