If you are using the following configuration under Xamarin.Android, you may experience an issue (Compile to dalvik: Unexpected top-level error) which prevents your build from succeeding:

  • Xamarin.Forms
  • Xamarin.Forms.Maps
  • Deploying to release

Resolving the issue

To resolve this issue, simply do the following:

  1. Right-click on your Xamarin.Android project
  2. Select “Properties”
  3. Open “Android Options” => “Advanced”
  4. Set “Java Max Heap Size” to 1G

Now, you should be able to build your Xamarin.Android project in release mode once more.

// Dave

Leave a Reply

Your email address will not be published. Required fields are marked *