I want use gradle plugin in android studio. I added classpath in build.gralde:
classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.0"
and
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
I put my map api key in local.properties (MAPS_API_KEY = "mykey") and use it on my manifest:
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="${MAPS_API_KEY}" />
My app run succefully But it's don't work for me.
Did you add your actual API key to your local.properties file? You need to make sure you have a reference to your actual API key so that the substitution for ${MAPS_API_KEY} is done. You can do so by adding:
MAPS_API_KEY = your key value here
to that file.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.