amay077 / Xamarin.Forms.GoogleMaps

Map library for Xamarin.Forms using Google maps API
https://www.nuget.org/packages/Xamarin.Forms.GoogleMaps/
MIT License
546 stars 349 forks source link

Could not create an native instance of the type 'Google.Maps.MapView' #802

Open flouo5 opened 1 year ago

flouo5 commented 1 year ago

VERSIONS

PLATFORMS

ACTUAL BEHAVIOR

As soon as I try to render a page including a Map I get the following error: Could not create an native instance of the type 'Google.Maps.MapView': the native class hasn't been loaded.

Even when launching the XFGoogleMapSample

ACTUAL SCREENSHOTS/STACKTRACE

[0:] An error occurred: 'Could not create an native instance of the type 'Google.Maps.MapView': the native class hasn't been loaded. It is possible to ignore this condition by setting ObjCRuntime.Class.ThrowOnInitFailure to false.'. Callstack: ' at Foundation.NSObject.InitializeObject (System.Boolean alloced) [0x0002e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/16.2.0.5/src/Xamarin.iOS/Foundation/NSObject2.cs:333 at Foundation.NSObject..ctor (Foundation.NSObjectFlag x) [0x0000d] in /Library/Frameworks/Xamarin.iOS.framework/Versions/16.2.0.5/src/Xamarin.iOS/Foundation/NSObject2.cs:200 at UIKit.UIResponder..ctor (Foundation.NSObjectFlag t) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/16.2.0.5/src/Xamarin.iOS/UIKit/UIResponder.g.cs:72 at UIKit.UIView..ctor (Foundation.NSObjectFlag t) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/16.2.0.5/src/Xamarin.iOS/UIKit/UIView.g.cs:86 at Google.Maps.MapView..ctor (CoreGraphics.CGRect frame) <0x11e729098 + 0x00008> in :0 at Xamarin.Forms.GoogleMaps.iOS.MapRenderer.OnElementChanged (Xamarin.Forms.Platform.iOS.ElementChangedEventArgs1[TElement] e) <0x11e71ffd0 + 0x001b6> in <126bc0f2a01e4ed0b03649f349d8dbcc>:0 at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].SetElement (TElement element) [0x00172] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:296 at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:158 at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00032] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:240 at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) [0x0003e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:119 at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () [0x0001e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:51 at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].SetElement (TElement element) [0x0012e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:283 at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:158 at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00032] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:240 at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) [0x0003e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:119 at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () [0x0001e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:51 at Xamarin.Forms.Platform.iOS.PageRenderer.ViewDidLoad () [0x0008f] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\PageRenderer.cs:252 at (wrapper managed-to-native) ObjCRuntime.Messaging.IntPtr_objc_msgSendSuper(intptr,intptr) at UIKit.UIViewController.get_View () [0x0002a] in /Library/Frameworks/Xamarin.iOS.framework/Versions/16.2.0.5/src/Xamarin.iOS/UIKit/UIViewController.g.cs:2910 at Xamarin.Forms.Platform.iOS.PageRenderer.get_NativeView () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\PageRenderer.cs:104 at Xamarin.Forms.Platform.iOS.PageRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x0003d] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\PageRenderer.cs:120 at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00032] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:240 at Xamarin.Forms.Platform.iOS.Platform.AddChild (Xamarin.Forms.VisualElement view) [0x00027] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:353 at Xamarin.Forms.Platform.iOS.Platform.WillAppear () [0x0003c] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:339 at Xamarin.Forms.Platform.iOS.PlatformRenderer.ViewWillAppear (System.Boolean animated) [0x00018] in D:\a\1\s\Xamarin.Forms.Platform.iOS\PlatformRenderer.cs:95 at (wrapper managed-to-native) ObjCRuntime.Messaging.void_objc_msgSend(intptr,intptr) at UIKit.UIWindow.MakeKeyAndVisible () [0x0000d] in /Library/Frameworks/Xamarin.iOS.framework/Versions/16.2.0.5/src/Xamarin.iOS/UIKit/UIWindow.g.cs:264 at Xamarin.Forms.Platform.iOS.FormsApplicationDelegate.SetMainPage () [0x00006] in D:\a\1\s\Xamarin.Forms.Platform.iOS\FormsApplicationDelegate.cs:181 at Xamarin.Forms.Platform.iOS.FormsApplicationDelegate.FinishedLaunching (UIKit.UIApplication uiApplication, Foundation.NSDictionary launchOptions) [0x00030] in D:\a\1\s\Xamarin.Forms.Platform.iOS\FormsApplicationDelegate.cs:57 at DriveBuy.iOS.AppDelegate.FinishedLaunching (UIKit.UIApplication app, Foundation.NSDictionary options) [0x0001f] in F:\source\Samuel\New\DriveBuy\DriveBuy\DriveBuy.iOS\AppDelegate.cs:29 at (wrapper managed-to-native) UIKit.UIApplication.xamarin_UIApplicationMain(int,string[],intptr,intptr,intptr&) at UIKit.UIApplication.UIApplicationMain (System.Int32 argc, System.String[] argv, System.IntPtr principalClassName, System.IntPtr delegateClassName) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/16.2.0.5/src/Xamarin.iOS/UIKit/UIApplication.cs:57 at UIKit.UIApplication.Main (System.String[] args, System.Type principalClass, System.Type delegateClass) [0x0003b] in /Library/Frameworks/Xamarin.iOS.framework/Versions/16.2.0.5/src/Xamarin.iOS/UIKit/UIApplication.cs:92 at DriveBuy.iOS.Application.Main (System.String[] args) [0x00001] in F:\source\Samuel\New\DriveBuy\DriveBuy\DriveBuy.iOS\Main.cs:17 at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&) at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:395 ' Die App wurde beendet.

EXPECTED BEHAVIOR

Rendering a Map

HOW TO REPRODUCE

  1. Add Xamarin.Forms.GoogleMaps Nuget Package as shown in the repository
  2. Add a simple Map to the MainPage.xaml
  3. Run the App
richardaustin123 commented 8 months ago

Did you manage to fix this? I'm going round in circles with the same issue

GreenleafDk commented 5 months ago

Running in the same circles. The bit question seems to be why not everyone is. What makes us "special"?

mosteiro12 commented 4 months ago

Same error using MAUI IOS

JRGironDev commented 4 months ago

Same error using MAUI IOS