mapbox / mapbox/mapbox-maps-android
Crash when code obfuscated with R8/proguard/dexguard
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 578
- Forks
- 161
- PR merge metrics
- No merged PRs in 30d
Description
Environment
- Android OS version: 35
- Devices affected: samsung SM-X700
- Maps SDK for Android Version: 11.14.0
Observed behavior and steps to reproduce
- Build compose-app in this repo in release mode
- Make sure it applied all the rules defined under project
- Launch any activity that contain @Composable MapboxMap using MapViewportState, crash happen
Caused by: com.mapbox.common.MapboxInitializerException: Failed to initialize: Attempt=2, exception=[pushOffsetToPath], initializer called 35333 ms ago, exception.message=[o.pushOffsetToPath: o.pushOffsetToPath: MapboxInvalidModuleException(type=CommonLibraryLoader)], exception.cause=[pushOffsetToPath], exception.cause.message=[o.pushOffsetToPath: MapboxInvalidModuleException(type=CommonLibraryLoader)], extractedNativeLibs=[], isInstantApp=[false], isMainThread=[true]
at com.mapbox.common.BaseMapboxInitializer$Companion.void init(java.lang.Class,boolean)(BaseMapboxInitializer.java:418)
at com.mapbox.common.BaseMapboxInitializer$Companion.void init(java.lang.Class)(BaseMapboxInitializer.java:114)
at com.mapbox.common.BaseMapboxInitializer.void init(java.lang.Class)(BaseMapboxInitializer.java:65353)
at com.mapbox.maps.CameraOptions.void ()(CameraOptions.java:223)
... 41 more
Caused by: androidx.startup.StartupException: o.pushOffsetToPath: o.pushOffsetToPath: MapboxInvalidModuleException(type=CommonLibraryLoader)
at androidx.startup.AppInitializer.java.lang.Object doInitialize(java.lang.Class,java.util.Set)(AppInitializer.java:187)
at androidx.startup.AppInitializer.java.lang.Object doInitialize(java.lang.Class)(AppInitializer.java:138)
at androidx.startup.AppInitializer.java.lang.Object initializeComponent(java.lang.Class)(AppInitializer.java:117)
at com.mapbox.common.BaseMapboxInitializer$Companion.void init(java.lang.Class,boolean)(BaseMapboxInitializer.java:242)
... 44 more
Expected behavior
App shouldn't crash when code is optimized and obfuscated with tool like proguard/dexguard
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Build the compose-app in release mode with the project’s existing optimization rules, then launch an activity containing @Composable MapboxMap with MapViewportState. Start with the MapboxInitializerException and MapboxInvalidModuleException stack trace; done means the optimized, obfuscated app launches without this initialization crash.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100