nativescript-community / nativescript-community/ui-mapbox

Error occurred while initializing telemetry

Open
#83 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
38
Forks
26
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in platforms/android/include.gradle, where mapboxTelemetryVersion is defined, and compare the current dependency with the reported 8.0.0 workaround. Reproduce with a new NativeScript app on Android Emulator API 33 and verify that initializing a map no longer raises the PendingIntent error while remaining compatible with the other Mapbox dependencies.

Written by the indexing model from the issue text.

Assessment

Tech stack
android
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.