Bug 4601 - MapsAndLocation demo crashes throwing exception'System.ArgumentException has been thrown' after clicking 'Show MapsActivity'.
Summary: MapsAndLocation demo crashes throwing exception'System.ArgumentException has ...
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 4.1.x
Hardware: PC Mac OS
: High normal
Target Milestone: ---
Assignee: Jonathan Pryor
Depends on:
Reported: 2012-04-23 15:41 UTC by PJ
Modified: 2012-04-24 16:00 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description PJ 2012-04-23 15:41:19 UTC
Steps to reproduce:
1. Open 'Maps and Location demo'.
2. Build the application.
3. Run the application.
4. Verify application launch successfully.
5. Click 'Maps and Activity'.
6. 'System.ArgumentException has been thrown.

Actual result:
After clicking on 'Show MapsActivity' following error displayed 'System.ArgumentException has been thrown'

Expected result:
Application should run successfully after clicking 'Show mapsActivity'.

Stack trace:
System.ArgumentException: Unable to determine JNI class for 'Android.GoogleMaps.MapView'.
Parameter name: TResult
at Java.Interop.JavaObjectExtensions._JavaCast<Android.GoogleMaps.MapView> (Android.Runtime.IJavaObject) <0x00310>
at Java.Interop.JavaObjectExtensions.JavaCast<Android.GoogleMaps.MapView> (Android.Runtime.IJavaObject) <0x00063>
at Android.Runtime.Extensions.JavaCast<Android.GoogleMaps.MapView> (Android.Runtime.IJavaObject) <0x00063>
at Android.App.Activity.FindViewById<Android.GoogleMaps.MapView> (int) <0x0007b>
at MapsAndLocationDemo.SampleMapActivity.OnCreate (Android.OS.Bundle) [0x0001f] in /Users/nischal/Desktop/xamarin-monodroid-samples-c271ba3/MapsAndLocationDemo/SampleMapActivity.cs:25
at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (intptr,intptr,intptr) [0x00010] in /Users/builder/data/lanes/monodroid-mac-master/d1bff948/source/monodroid/src/Mono.Android/platforms/android-10/src/generated/Android.App.Activity.cs:1477
at (wrapper dynamic-method) object.581b1bdd-34ac-423c-a4e4-00eab288b722 (intptr,intptr,intptr) <IL 0x00012, 0x00033>


Mac 10.7.3
Device: Samsung Galaxy S2
Target Framework 2.3 Gingerbraed
Comment 1 Jonathan Pryor 2012-04-23 22:52:48 UTC
Fixed in 240492ec.
Comment 2 PJ 2012-04-24 11:37:10 UTC
Verified fix as per 4594, 4592.
Comment 3 PJ 2012-04-24 16:00:19 UTC
I tested this on some of the devices that I was able to reproduce 4594 and 4592 on and I've re-verified that this is fixed on both Debug and Release.