Closed borisengler closed 3 months ago
Could you please let us know which version of Android the crash occurred on? Did you run the sample code of MSDK V5 directly, or did you integrate the map control into your own app? If you ran the sample code of MSDK directly, you can try filling in the API_KEY of Google Maps at the location shown in the image.
It happens on Android 11. I ran MSDK V5 sample directy, but I changed application ID so I could use my DJI Api key.
Now I changed GMAP_API_KEY variable in gradle.properties too, and I get:
FATAL EXCEPTION: main
Process: com.ginasystem.drone, PID: 18122
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ginasystem.drone/dji.v5.ux.sample.showcase.defaultlayout.DefaultLayoutActivity}: java.lang.RuntimeException: API key not found. Check that <meta-data android:name="com.google.android.geo.API_KEY" android:value="your API key"/> is in the <application> element of AndroidManifest.xml
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3846)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4022)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2336)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:246)
at android.app.ActivityThread.main(ActivityThread.java:8653)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
Caused by: java.lang.RuntimeException: API key not found. Check that <meta-data android:name="com.google.android.geo.API_KEY" android:value="your API key"/> is in the <application> element of AndroidManifest.xml
That's not problem to fix, I just moved <meta-data android:name="com.google.android.geo.API_KEY"...
from <manifest>
to <application
.
But I still get error mentioned in issue when I try to use initGoogleMap instead of initAMap in DefaultLayoutActivity.java
You can try adding
Furthermore, if you only need to try using Google Maps on the V5 sample code, I do not recommend moving
Thanks, adding that to manifest helped.
Agent comment from yating.liao in Zendesk ticket #103306:
I am glad to have been able to help you.
°°°
Hello I am using latest version of Sample app and when I try to use initGoogleMap, app crashes. My only changes are:
I get this error in LogCat: