[WM 20 android] Error trying to generate apk file

Startbeitrag von Andres Sanchez am 21.09.2015 18:19

I would appreciate if someone could help me solve this problem,

I am getting the following error, I tried WM19 and get the same error.
This are projects already working in WM 19

Failure creating the Android application named .

Command Line: "C:\Program Files (x86)\Java\jdk1.8.0_11\bin\java.exe" -Xmx1024m -Xss1m -Djava.ext.dirs=.\build-tools\21.1.2\lib -jar .\build-tools\21.1.2\lib\dx.jar --dex --incremental --output="C:\My Projects Mobile 20\PMXact\Android\Generation\bin\classes.dex" "C:\My Projects Mobile 20\PMXact\Android\Generation\bin\classes" "C:\My Projects Mobile 20\PMXact\Android\Generation\libs"

Error returned:
Error occurred during initialization of VM
Could not reserve enough space for 1048576KB object heap


Hi Andres,

from the error message, I would think that your project got too big...

I think that PCSoft has a faq available about that problem, but you can probably compile by using the "optimize the apk" checkbox (slower) in the compile process

Best regards

von Fabrice Harari - am 21.09.2015 18:35
Hi Andres,
WM20 has an option to "reduce the size of the generated code" somewhere in the generation wizard (advanced options from the top of my head). It helped in my situation.
Please don't ask why such an option is there in the first place. I would say we always want to optimize our code.....

von Arie - am 21.09.2015 19:19
Hi Fabrice:

>>from the error message, I would think that your project got too big...

I probably think the same way, but my project has 6 windows and 1 class.

I tried the optimize option, with no luck


Andres Sanchez

von Andres Sanchez - am 21.09.2015 22:46

Thanks for you help, I have tried that option and still getting the error.

Andres Sanchez

von Andres Sanchez - am 21.09.2015 22:47

You need to change the -Xmx1024m parameter because it is probably the Java compiler that runs out of heap while compiling your application.

You can change this in this file: C:\WinDev Mobile 20\Programs\Framework\Android\WDJava.dat

Change alle occurences of -Xmx1024m to -Xmx4096m

Then restart Windev Mobile and fully recompile your application.

Other options are that you use the 64bit Java compiler.

Hope this works for you !

von Danny Lauwers - am 22.09.2015 06:44

Re: [WM 20 android] Error trying to generate apk file - SOLVED


There was no -Xmx1024m in the file, instead it was a -Xmx$JavaXmx$ which i changed to -Xmx4096m and there was a different error, so I installed JRE 64-bit and that SOLVED the problem

Thanks, to all

Andres Sanchez

von Andres Sanchez - am 22.09.2015 14:11
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.