Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Google Map SDK Toolbar issue -- not launching external map

The app has a Google Map built-in by using Maps SDK. Tapping one of the icons on the Map Toolbar should launch the external Maps app.

enter image description here

The launching of the external Maps app had been working well until targetSDKVersion=29. When targetSDKVersion=30, the launching failed, and the screen showed this message: Google Maps is not installed or is disabled.

Why is that?

like image 242
autumnmaple Avatar asked Oct 25 '20 16:10

autumnmaple


1 Answers

EDIT: This issue should be fixed in version 17.0.1 of the library. You can refer to the release notes.

I work in Developer Relations for Google Maps. This issue is due to package visibility requirements introduced in Android 11. You can read more about it here. Essentially, your app needs to declare in the AndroidManifest.xml all the packages it requires to function correctly.

To fix this, you will need to add the Google Maps package "com.google.android.apps.maps" as an entry in your AndroidManifest.xml <queries> entry:

<manifest package="com.your.package">
  <queries>
    <package android:name="com.google.android.apps.maps" />
  </queries>
  ...
</manifest>

You can also refer to our sample.

like image 127
Chris Arriola Avatar answered Sep 29 '22 16:09

Chris Arriola