Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Google Maps] Attempting to JIT compile method Init(string, PlatformConfig) #540

Open
JPZV opened this issue Mar 15, 2022 · 0 comments
Open

Comments

@JPZV
Copy link

JPZV commented Mar 15, 2022

After updating the library from 3.9.0 to 6.0.1, the app crashes immediately while calling Xamarin.FormsGoogleMaps.Init(string, PlatformConfig) with the following message:

System.ExecutionEngineException: Attempting to JIT compile method 'void Xamarin.FormsGoogleMaps:Init(string,Xamarin.Forms.GoogleMaps.iOS.PlatformConfig)' while running in aot-only mode. See https://docs.microsoft.com/xamarin/ios/internals/limitations for more information.

That by using the following code:

public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
    global::Xamarin.Forms.Forms.Init();
    global::Xamarin.Forms.FormsMaterial.Init();
    
    UIApplication.SharedApplication.SetMinimumBackgroundFetchInterval(60 * 60);
    
    Xamarin.FormsGoogleMaps.Init("MyGoogleMapsKey");
    
    //...
}

Researching in Google, they say I've to enable "Mono interpreter" in iOS Build, but that creates another exception at the same line:

System.MissingMethodException: Method not found: bool Google.Maps.MapServices.ProvideAPIKey(string)

On both cases there's no useful information at the stack trace, as it ends on my code without going any further.

Some extra info:

  1. OS Version with problems: At least with iOS 15
  2. Device: iPhone 8 with iOS 15.3.1
  3. Third parties libraries: (there're a lot, so I'll only put the most remarkable)
    a. Xamarin.Forms.GoogleMaps 3.3.0
    b. Plugin.CloudFirestore 4.1.0
    c. Plugin.FirebaseAuth 4.1.0
    d. Xamarin.Forms 5.0.0.2337
    e. Xamarin.Essentials 1.7.1
  4. Xcode version: 13.2.1
  5. Visual Studio version: 8.10.20 (for Mac)
  6. Workaround: Downgrading Xamarin.Google.iOS.Maps to 3.9.0

If you need any more info, please let me know. For now I have to downgrade the package back to 3.9.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant