0
votes

I am using private build agent for my builds. (This works on VS Appcenter, if you use their machine but it costs and build is slow, or if you use Hosted VS2017 from VSTS, anyway I am using my own private agent for all VSTS builds, speed and cost).

Error is complaining about JavaMaximumHeapSize.

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2188,3): Error XA5213: java.lang.OutOfMemoryError. Consider increasing the value of $(JavaMaximumHeapSize). Java ran out of memory while executing 'java.exe -jar "C:\Program Files (x86)\Android\android-sdk\build-tools\27.0.3\lib\dx.jar" --dex --no-strict --multi-dex --main-dex-list=obj\Release\multidex.keep --output obj\Release\android\bin D:\agent_work\9\s\src\Yo.MobileApp.Android\obj\Release\android\bin\classes.zip "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v8.1\mono.android.jar" "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\Android\android-support-multidex.jar" obj\Release\lp\1\jl\formsviewgroup.jar obj\Release\lp\31\jl\arch-core-common.jar obj\Release\lp\32\jl\arch-lifecycle-common.jar obj\Release\lp\33\jl\bin\classes.jar obj\Release\lp\34\jl\bin\classes.jar ob... C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2188,3): error XA5213: java.lang.OutOfMemoryError. Consider increasing the value of $(JavaMaximumHeapSize). Java ran out of memory while executing 'java.exe -jar "C:\Program Files (x86)\Android\android-sdk\build-tools\27.0.3\lib\dx.jar" --dex --no-strict --multi-dex --main-dex-list=obj\Release\multidex.keep --output obj\Release\android\bin D:\agent_work\9\s\src\Yo.MobileApp.Android\obj\Release\android\bin\classes.zip "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v8.1\mono.android.jar" "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\Android\android-support-multidex.jar" obj\Release\lp\1\jl\formsviewgroup.jar obj\Release\lp\31\jl\arch-core-common.jar obj\Release\lp\32\jl\arch-lifecycle-common.jar obj\Release\lp\33\jl\bin\classes.jar obj\Release\lp\34\jl\bin\classes.jar obj\Release...

  • I already increased JavaMaximumHeapSize to 1G inside of Application Manifest.
  • I already set JDK to 8 and selected x86 architecture: enter image description here

If I put x64 arch and JDK 8 or same for JDK9 I get error:

2018-04-14T10:32:54.9545073Z ##[error]Cannot bind argument to parameter 'KeyName' because it is an empty string.

1
"I already increased JavaMaximumHeapSize to 1G inside of Application Manifest", Did you manually edit the manifest or did you used the properties editor of the .csproj?AarónBC.
I fixed it I’ll write answer latersensei
Use a 64 bit version of the JDK.Jon Douglas

1 Answers

1
votes

JDK8 and x64 solves teh problem.