newbie
newbie

Reputation: 57

Xamarin Android Google Maps error in Fragment

I'm getting an error while displaying maps in a fragment, I've been searching for the solution and Tried several codes but nothing seems to work.

MainActivity.xml

enter image description here

StackTrace: {Android.Views.InflateException: Binary XML file line #1: Binary XML file line #2: Error inflating class fragment ---> Android.Views.InflateException: Binary XML file line #2: Error inflating class fragment ---> Java.Lang.RuntimeException: API key not found.
Check that is in the element of AndroidManifest.xml

it says API Key not found, but i did declared it in manifest and validated it using http://yougapi.com/tools/google-api-key-checker.php

AndroidManifest.xml enter image description here

activity_main.xml

enter image description here

PS: Im using android 9.0 physical device for debugging

Upvotes: 0

Views: 124

Answers (1)

Leon Lu
Leon Lu

Reputation: 9234

Please make sure if you have install Xamarin.GooglePlayServices.Maps package from NuGet. enter image description here

And you used Android 9.0 physical device, please make sure your device if have Google Play services

I test my demo in the Android 10.0 emulator, it worked as normal. enter image description here

Here is my demo. You can test it.

https://github.com/851265601/XAndroidMap

Upvotes: 1

Related Questions