Xamarin.forms.googlemaps: Updated to Latest But Getting Errors Not Seen Before

Created on 5 Dec 2017  路  21Comments  路  Source: amay077/Xamarin.Forms.GoogleMaps

i upgraded to version 2.2.1

i get the following error:

Attempting to JIT compile method 'Xamarin.Forms.GoogleMaps.iOS.MapRenderer:UpdateMapType ()' while running in aot-only mode. See https://developer.xamarin.com/guides/ios/advanced_topics/limitations/ for more information.

Any ideas?

bug

All 21 comments

I also got this issue any here are my dump stack trace:
Note:

  • Xamarin.Google.iOS.Maps.2.4.0
  • Xamarin.Forms.GoogleMaps.2.3.0-beta2
2017-12-05 11:31:42.181 Demo[27788:390806] Invalid IL code in Xamarin.Forms.GoogleMaps.iOS.MapRenderer:UpdateMapType (): IL_0039: callvirt  0x0a000187
2017-12-05 11:31:42.204 Demo[27788:390806]   at Xamarin.Forms.GoogleMaps.iOS.MapRenderer.OnElementChanged (Xamarin.Forms.Platform.iOS.ElementChangedEventArgs`1[TElement] e) [0x001c6] in <db4808d75f29442d9629a1e7ecc13800>:0 
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x00110] in D:\agent\_work\2\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:189 
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00000] in D:\agent\_work\2\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:140 
  at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in D:\agent\_work\2\s\Xamarin.Forms.Platform.iOS\Platform.cs:193 
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) [0x0002a] in D:\agent\_work\2\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:77 
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () [0x0001e] in D:\agent\_work\2\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:45 
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x000cc] in D:\agent\_work\2\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:176 
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00000] in D:\agent\_work\2\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:140 
  at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in D:\agent\_work\2\s\Xamarin.Forms.Platform.iOS\Platform.cs:193 
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) [0x0002a] in D:\agent\_work\2\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:77 
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () [0x0001e] in D:\agent\_work\2\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:45 
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x000cc] in D:\agent\_work\2\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:176 
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00000] in D:\agent\_work\2\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:140 
  at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in D:\agent\_work\2\s\Xamarin.Forms.Platform.iOS\Platform.cs:193 
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) [0x0002a] in D:\agent\_work\2\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:77 
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () [0x0001e] in D:\agent\_work\2\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:45 
  at Xamarin.Forms.Platform.iOS.PageRenderer.ViewDidLoad () [0x00086] in D:\agent\_work\2\s\Xamarin.Forms.Platform.iOS\Renderers\PageRenderer.cs:123 
  at (wrapper managed-to-native) ObjCRuntime.Messaging:IntPtr_objc_msgSendSuper (intptr,intptr)
  at UIKit.UIViewController.get_View () [0x00030] in /Users/builder/data/lanes/5520/51128b8c/source/xamarin-macios/src/build/ios/native/UIKit/UIViewController.g.cs:2983 
  at Xamarin.Forms.Platform.iOS.PageRenderer.get_NativeView () [0x00000] in D:\agent\_work\2\s\Xamarin.Forms.Platform.iOS\Renderers\PageRenderer.cs:41 
  at Xamarin.Forms.Platform.iOS.PageRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x0004f] in D:\agent\_work\2\s\Xamarin.Forms.Platform.iOS\Renderers\PageRenderer.cs:56 
  at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in D:\agent\_work\2\s\Xamarin.Forms.Platform.iOS\Platform.cs:193 
  at Xamarin.Forms.Platform.iOS.TabbedRenderer.SetupPage (Xamarin.Forms.Page page, System.Int32 index) [0x0000a] in D:\agent\_work\2\s\Xamarin.Forms.Platform.iOS\Renderers\TabbedRenderer.cs:286 
  at Xamarin.Forms.Platform.iOS.TabbedRenderer.Reset () [0x0001c] in D:\agent\_work\2\s\Xamarin.Forms.Platform.iOS\Renderers\TabbedRenderer.cs:263 
  at Xamarin.Forms.Internals.NotifyCollectionChangedEventArgsExtensions.Apply (System.Collections.Specialized.NotifyCollectionChangedEventArgs self, System.Action`3[T1,T2,T3] insert, System.Action`2[T1,T2] removeAt, System.Action reset) [0x001e1] in D:\agent\_work\2\s\Xamarin.Forms.Core\Internals\NotifyCollectionChangedEventArgsExtensions.cs:79 
  at Xamarin.Forms.Platform.iOS.TabbedRenderer.OnPagesChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00000] in D:\agent\_work\2\s\Xamarin.Forms.Platform.iOS\Renderers\TabbedRenderer.cs:201 
  at Xamarin.Forms.Platform.iOS.TabbedRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x0005b] in D:\agent\_work\2\s\Xamarin.Forms.Platform.iOS\Renderers\TabbedRenderer.cs:66 

at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in D:\agent\_work\2\s\Xamarin.Forms.Platform.iOS\Platform.cs:193 
  at Xamarin.Forms.Platform.iOS.NavigationRenderer.CreateViewControllerForPage (Xamarin.Forms.Page page) [0x00008] in D:\agent\_work\2\s\Xamarin.Forms.Platform.iOS\Renderers\NavigationRenderer.cs:345 
  at Xamarin.Forms.Platform.iOS.NavigationRenderer+<OnPushAsync>d__45.MoveNext () [0x00016] in D:\agent\_work\2\s\Xamarin.Forms.Platform.iOS\Renderers\NavigationRenderer.cs:332 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.3.0.47/src/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:151 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /Library/Frameworks/Xamarin.iOS.
framework/Versions/11.3.0.47/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.3.0.47/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.3.0.47/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.3.0.47/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:357 
  at Xamarin.Forms.Platform.iOS.NavigationRenderer+<<ViewDidLoad>b__40_0>d.MoveNext () [0x00022]
 in D:\agent\_work\2\s\Xamarin.Forms.Platform.iOS\Renderers\NavigationRenderer.cs:216 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.3.0.47/src/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:151 
  at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0 (System.Object state) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.3.0.47/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1018 
  at UIKit.UIKitSynchronizationContext+<Post>c__AnonStorey0.<>m__0 () [0x00000] in /Users/builder/data/lanes/5520/51128b8c/source/xamarin-macios/src/UIKit/UIKitSynchronizationContext.cs:24 
  at Foundation.NSAsyncActionDispatcher.Apply () [0x00000] in /Users/builder/data/lanes/5520/51128b8c/source/xamarin-macios/src/Foundat
ion/NSAction.cs:163 
--- End of stack trace from previous location where exception was thrown ---
  at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Users/builder/data/lanes/5520/51128b8c/source/xamarin-macios/src/UIKit/UIApplication.cs:79 
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/5520/51128b8c/source/xamarin-macios/src/UIKit/UIApplication.cs:63 
  at Omnicasa.Mobile.iOS.Program.Main (System.String[] args) [0x00108] in D:\Projects\omnicasa-mobile-droid\source\Omnicasa.Mobile.iOS\Program.cs:62 
2017-12-05 11:31:42.457 Omnicasa[27788:390990] 11:31:42 Omnicasa.Synchronization.Domain.SyncDown.Internal.RequestCreateFile CREATE FILE RESPONSE:{
  "session": "7e0da83931d114bfed8555f1d58adba23358992f",
  "synchronizedDate": "2017-12-05T04:32:44.127Z"
}

I am with the same issue only in iOS.

  • Xamarin.Google.iOS.Maps - 2.4.0
  • Xamarin.Forms.GoogleMaps - 2.2.1

System.InvalidProgramException has been thrown

Invalid IL code in Xamarin.Forms.GoogleMaps.iOS.MapRenderer:UpdateMapType (): IL_0039: callvirt 0x0a000185

Same problem

System.InvalidProgramException: Invalid IL code in Xamarin.Forms.GoogleMaps.iOS.MapRenderer:UpdateMapType (): IL_0039: callvirt 0x0a000182

Good afternoon, I has that bug but I can solve put the previous version (2.2.0) of nuget in the pcl project and IOS project. I think it's better to solve Your mistake plis, Thanks

I downgraded the Xamarin.Forms.GoogleMaps to 2.2.0 in both Sample and iOS package, but still the same error. The error is in Main.cs file in iOS. Any solution please...

System.InvalidProgramException has been thrown

Invalid IL code in Xamarin.Forms.GoogleMaps.iOS.MapRenderer:UpdateMapType (): IL_0039: callvirt 0x0a000185

Seem it is the latest version of Visual Studio that broke it. I also downgrade and error still there.

Also having this error. I also downgraded Xamarin.Forms.GoogleMaps to 2.2.0 and error still exists.

i downgrade Xamarin.Google.IOS.Maps 2.1.0.2 (Xamarin.Forms.GoogleMaps still lastest version, 2.2.1). And it works. Only Xamarin.Google.IOS.Maps 2.4.0 or higher raise error

@nt2vna Do you mean Xamarin.Google.iOS.Maps? I searched for version 2.10.2 but the latest version of Xamarin.Google.iOS.Maps is 2.5.0.x...

I downgraded Xamarin.Google.iOS.Maps to 2.1.0.2 . The error is gone now..But only blank Map is rendered with Google Icon..

I downgraded to 2.1.0.2 and iOS works fine now (with GoogleMaps 2.2.1). I got the correct map.

I suspects Xamarin.Google.iOS.Maps.2.4.0+ has breaking changes.
I will depends Xamarin.Google.iOS.Maps.2.4.0+ at Xamarin.Forms.GoogleMaps vNext(maybe v2.3-stable).

As you can see, MapViewType definition had changed in 2.4.0+
https://github.com/xamarin/GoogleApisForiOSComponents/commit/48918a5e3401425399b042e59f2399528015d415#diff-743aad948c88cbe527e28b2752be68e5

So I suppose that it'll be solved by letting Xamarin.Forms.GoogleMaps depends on Xamarin.Google.iOS.Maps.2.4.0+ as amay said.

I just released Xamarin.Forms.GoogleMaps v2.3.0-beta3 that resolved this issue.

Notice: Now your apps requires Xamarin.Google.iOS.Maps.2.5.0 .

2.3.0-beta3 fixed the problem. Now works

When adding pin 2.3.0-beta3 throws System.ArgumentNullException.
This error does not show with Xamarin.Google.iOS.Maps to 2.1.0.2.

2017-12-11 9 46 36

Seems like this is caused by
Icon = BitmapDescriptorFactory.FromBundle(name)

Foundation.NSData.FromFile (and Xamarin.Forms.GoogleMaps.iOS.Extensions.BitmapDescriptorExtensions.ToUIImage) throws an error...

@woojung3 , Could you try below code in your app project?

var path = NSBundle.MainBundle.PathForResource("your_image.png", "");

If you can't get path then please check setting your image's action type as BundleResource.

Nevertheless you still have trouble, please show we code or sample apps for reproduce.

@amay077 Thank you for your response.
Path was null. I added file.png along with [email protected] (which was already there) and now the code works. With 2.2.1 GoogleMaps [email protected] only was ok but with 2.3.0-beta3 I have to use file.png and [email protected].

@woojung3 , I noticed that it is my bug. 馃檹
Fixing in https://github.com/amay077/Xamarin.Forms.GoogleMaps/pull/435 and update sample apps.

@woojung3 , I just released v2.3.0-beta4 that fixed https://github.com/amay077/Xamarin.Forms.GoogleMaps/issues/431#issuecomment-350916596 .
You can use [email protected] only in your project.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mammadkoma picture mammadkoma  路  6Comments

idan-rubin picture idan-rubin  路  6Comments

goodguy010 picture goodguy010  路  5Comments

amay077 picture amay077  路  4Comments

dreamsystems picture dreamsystems  路  5Comments