mapbox / mapbox/mapbox-maps-android

Startup crash on Pixel 6 Pro caused by Mapbox SDK initialization

Open
#2,721 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug :beetle:
Dominant language
Kotlin
Stars
578
Forks
161
PR merge metrics
No merged PRs in 30d

Description

## Environment

- Android OS version: 12
- Devices affected: 1
- Device model: Pixel 6 Pro
- Maps SDK Version:
* com.mapbox.maps:android-ndk27:11.13.1
* com.mapbox.extension:maps-compose:11.13.1

## Observed behavior and steps to reproduce

Image

Application crashes immediately during startup while initializing Mapbox SDK in Application.onCreate().
```
Fatal Exception: java.lang.ExceptionInInitializerError
at com.mapbox.common.MapboxOptionsImpl.setAccessToken(MapboxOptionsImpl.java)
at com.mapbox.common.MapboxOptions.setAccessToken(MapboxOptions.kt:23)
at com.ackcio.beam.App.onCreate(App.kt:96)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1223)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6762)
at android.app.ActivityThread.access$1500(ActivityThread.java:256)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2091)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7870)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1009)
```

Steps to reproduce

1. Install and launch the application on Pixel 6 Pro running Android 12.
2. Application crashes during startup.
3. Crash occurs while calling:

## Expected behavior

Application should initialize Mapbox SDK successfully and continue loading without crashing.

## Notes / preliminary analysis

Crash occurs during static initialization of Mapbox native components.
* Failure point is:
* MapboxOptions.setAccessToken(...)

Application is using:
* com.mapbox.maps:android-ndk27:11.13.1
* com.mapbox.extension:maps-compose:11.13.1

Contributor guide

Open the contributing guide

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 by reproducing the startup crash on a Pixel 6 Pro running Android 12 with Mapbox SDK 11.13.1, then trace the call from App.kt:96 through MapboxOptions.setAccessToken and the static native initialization. Done means the application initializes Mapbox successfully and continues loading without the ExceptionInInitializerError.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.