2
votes

Hello Guys i found this errors while generating sign apk.

Error:Error: Could not create the Java Virtual Machine.
Error:Error: A fatal exception has occurred. Program will exit.
Error:Invalid maximum heap size: -Xmx4g
Error:The specified size exceeds the maximum representable size.

My configuration - Android Studio 3.0.1 Build #AI-171.4443003, built on November 9, 2017 JRE: 1.8.0_152-release-915-b01 amd64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Windows 10 10.0

1
Are you using a 64bit JRE and 64bit android studio?Chris Stillwell
yes indeed i am using 64bit JRE and 64bit android studioJack N
Android Studio 3.0.1 Build #AI-171.4443003, built on November 9, 2017 JRE: 1.8.0_152-release-915-b01 amd64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Windows 10 10.0Jack N
How much memory does your machine have?Henry
6.00 GB (4.96 GB Usable)Jack N

1 Answers

0
votes

Check the java version used by the project. It can be different from the one used by Studio.

For example :

enter image description here