mapbox / mapbox-android-demo

Google Play demo app for the Mapbox Maps SDK for Android
https://play.google.com/store/apps/details?id=com.mapbox.mapboxandroiddemo
BSD 2-Clause "Simplified" License
720 stars 493 forks source link

java.lang.RuntimeException: Mapbox.getTelemetry() == null in debug config #1395

Closed tsuz closed 3 years ago

tsuz commented 3 years ago

Description I get this below error when I run the android demo.

2021-01-18 18:16:16.429 23109-23109/com.mapbox.mapboxandroiddemo.debug E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.mapbox.mapboxandroiddemo.debug, PID: 23109
    java.lang.RuntimeException: Unable to create application com.mapbox.mapboxandroiddemo.MapboxApplication: java.lang.RuntimeException: Mapbox.getTelemetry() == null in debug config
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6717)
        at android.app.ActivityThread.access$1300(ActivityThread.java:237)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:223)
        at android.app.ActivityThread.main(ActivityThread.java:7656)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
     Caused by: java.lang.RuntimeException: Mapbox.getTelemetry() == null in debug config
        at com.mapbox.mapboxandroiddemo.MapboxApplication.onCreate(MapboxApplication.java:25)
        at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1192)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6712)
        at android.app.ActivityThread.access$1300(ActivityThread.java:237) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913) 
        at android.os.Handler.dispatchMessage(Handler.java:106) 
        at android.os.Looper.loop(Looper.java:223) 
        at android.app.ActivityThread.main(ActivityThread.java:7656) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) 

Expected

It should not crash with the above error.

Observed It crashes with above error.

tsuz commented 3 years ago

The error went away after adding value for access_token in <project>/SharedCode/src/main/res/values/developer-config.xml