Why does my Xamarin.Forms.Maps Android project fail with COMPILETODALVIK : UNEXPECTED TOP-LEVEL ERROR?

PDF for offline use:

Let us know how you feel about this.


0/250
Thanks for the feedback!

This error may be seen in the Error pad of Xamarin Studio or in the Build Output window of Visual Studio; in Android projects using Xamarin.Forms.Maps.

This is most commonly resolved by increasing the Java Heap Size for your Xamarin.Android project. Follow these steps to increase the heap size:

Visual Studio

  1. Right-click the Android project & open the project options.
  2. Go to Android Options -> Advanced
  3. In the Java heap size text box enter 1G.
  4. Rebuild the project.

Screenshot of the Visual Studio Project Options

Xamarin Studio

  1. Right-click the Android project & open the project options.
  2. Go to Build -> Android Build -> Advanced
  3. In the Java heap size text box enter 1G.
  4. Rebuild the project.

Screenshot of the Xamarin Studio Project Options

Xamarin Workbook

If it's not already installed, install the Xamarin Workbooks app first. The workbook file should download automatically, but if it doesn't, just click to start the workbook download manually.