Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error occurred while initializing telemetry #83

Open
youssefgh opened this issue Jul 8, 2022 · 1 comment
Open

Error occurred while initializing telemetry #83

youssefgh opened this issue Jul 8, 2022 · 1 comment

Comments

@youssefgh
Copy link

2022-07-08 04:14:05.775 21921-21921/org.nativescript.testApp E/Mbgl-Mapbox: Error occurred while initializing telemetry
    java.lang.IllegalArgumentException: org.nativescript.testApp: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
    Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
        at android.app.PendingIntent.checkFlags(PendingIntent.java:401)
        at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:671)
        at android.app.PendingIntent.getBroadcast(PendingIntent.java:658)
        at com.mapbox.android.telemetry.AlarmSchedulerFlusher.register(AlarmSchedulerFlusher.java:31)
        at com.mapbox.android.telemetry.MapboxTelemetry.startAlarm(MapboxTelemetry.java:380)
        at com.mapbox.android.telemetry.MapboxTelemetry.startTelemetry(MapboxTelemetry.java:374)
        at com.mapbox.android.telemetry.MapboxTelemetry.enable(MapboxTelemetry.java:114)
        at com.mapbox.mapboxsdk.module.telemetry.TelemetryImpl.<init>(TelemetryImpl.java:33)
        at com.mapbox.mapboxsdk.ModuleProviderImpl.obtainTelemetry(ModuleProviderImpl.java:22)
        at com.mapbox.mapboxsdk.Mapbox.initializeTelemetry(Mapbox.java:167)
        at com.mapbox.mapboxsdk.Mapbox.getInstance(Mapbox.java:64)
        at com.tns.Runtime.callJSMethodNative(Native Method)
        at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1302)
        at com.tns.Runtime.callJSMethodImpl(Runtime.java:1188)
        at com.tns.Runtime.callJSMethod(Runtime.java:1175)
        at com.tns.Runtime.callJSMethod(Runtime.java:1153)
        at com.tns.Runtime.callJSMethod(Runtime.java:1149)
        at com.tns.gen.java.lang.Runnable.run(Runnable.java:17)
        at android.os.Handler.handleCallback(Handler.java:942)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loopOnce(Looper.java:201)
        at android.os.Looper.loop(Looper.java:288)
        at android.app.ActivityThread.main(ActivityThread.java:7892)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

Device :

Android Emulator API 33

How to reproduce :

create a new NS app, add ui-mapbox plugin [,add TelemetryService] and create a basic component that shows a map

Workaround in dev environment :

upgrade mapboxTelemetry in node_modules/@nativescript-community/ui-mapbox/platforms/android/include.gradle with : def mapboxTelemetryVersion = "8.0.0"

mapboxTelemetry 8.0.0 seems compatible with android API 31+ but am not sure about cross compatibility with other mapbox dependencies

@youssefgh
Copy link
Author

Putting :

project.ext {
  mapboxTelemetryVersion = "8.0.0"
}

in App_Resources/Android/before-plugins.gradle seems like a solution but waiting for plugin devs input

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant