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:
- Right-click on your Xamarin.Android project
- Select “Properties”
- Open “Android Options” => “Advanced”
- Set “Java Max Heap Size” to 1G
Now, you should be able to build your Xamarin.Android project in release mode once more.
// Dave