I have implemented the continuous integration of xamarin.form project with TFS. I am using "Hosted VS2017" as agent queue. Since few days I am facing one issue, my code builds successfully on my machine but not in TFS. Nuget restores successfully but "Build Xamarin.Android Project xyz/xyz.Android/xyz.Android.csproj" fails and it shows me below error
COMPILETODALVIK (0, 0) COMPILETODALVIK(0,0): Error :
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2028,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\26.0.2\lib\dx.jar" --no-strict --dex --output=obj\Release\android\bin obj\Release\android\bin\classes "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v8.0\mono.android.jar" obj\Release__library_projects__\FormsViewGroup\library_project_imports\formsviewgroup.jar obj\Release__library_projects__\HockeySDK.AndroidBindings\library_project_imports\bin\classes.jar obj\Release__library_projects__\Xamarin.Android.Support.Animated.Vector.Drawable\library_project_imports\bin\classes.jar obj\Release__library_projects__\Xamarin.Android.Support.Compat\library_project_imports\bin\classes.jar obj\Relea...
Process 'msbuild.exe' exited with code '1'.
Error XA5213: java.lang.OutOfMemoryError. Consider increasing the value of $(JavaMaximumHeapSize). Java ran out of memory while executing 'java.exe -jar
I increase the heap size to 1G, 2G but none of the solution work for me.
Its properly working on my machine but not working in TFS
Usually, When this kind of error comes into our visual studio it may be solved by rebuilding the project. How to rebuild the project into TFS?
I have tried different possible solutions but can't able to resolve the issue
Please try below items to narrow down the issue:
Then try it again.
If that still not work, you can try to deploy a private agent on Windows, then install/set SDK/components on the private anent machine same as your Develop machine which worked locally. Then select the private agent to build.