Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Cannot build combined mobile and web solution #4801


User avatar
0
TimMackey created

I created a "projectname.All" solution. After much trial and error I got past the package number issue, but still get build errors. The current error is "java.lang.OutOfMemoryError. Consider increasing the value of $(JavaMaximumHeapSize)." The ...\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\Android\common.targets\Xamarin.Android.Common.targets file contains the setting "JavaMaximumHeapSize="$(JavaMaximumHeapSize)"". How/where is the actual value set? Or is this a bogus error message because of some other setting?


2 Answer(s)
  • User Avatar
    0
    alper created
    Support Team

    Hi,

    Never had such an issue before. As error says, let's increase it. Right click the *Mobile.Droid Project > Properties > Android Options > Advanced > Java Max Heap Size. [attachment=1:1b0bora6]max-heapsize.jpg[/attachment:1b0bora6]

    NOTE : Xamarin sometimes throws unrelated exceptions! Before increasing heap size, delete all bin and obj folders in your solution directory. Move your solution to the root of your hard drive like C:\ or D:\ (to shorten your path) Open your emulator with Android Emulator Manager (AVD) in Visual Studio ( I mean, don't start with F5 because Visual Studio sometimes cannot connect to debugger on time.) Let the emulator successfully start up. If you have installed the application to the emulator, then uninstall it. Then compile the solution and start Mobile.Droid debugging with F5.

    There are about 32 folders (BIN & OBJ folders) that you need to delete. If you don't want to delete all those folders manually, I have created a batch file that does it for you. Put the "Delete BIN OBJ Folders.bat" in the *.sln folder and run it. It deletes all BIN & OBJ folders automatically. [attachment=0:1b0bora6]Delete BIN OBJ Folders.rar[/attachment:1b0bora6] Delete BIN OBJ Folders.rar

  • User Avatar
    0
    TimMackey created

    Ran 'Delete BIN OBJ Files.bat' and set Heap size to 1G. Build succeeded with no errors. Thank you.