Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

when use proguard with mapbox #15487

Closed
sattarsh opened this issue Aug 26, 2019 · 2 comments
Closed

when use proguard with mapbox #15487

sattarsh opened this issue Aug 26, 2019 · 2 comments
Labels
Android Mapbox Maps SDK for Android needs information

Comments

@sattarsh
Copy link

sattarsh commented Aug 26, 2019

when use mapbox with proguard in android studio app crash
lib:
//map
implementation 'ir.map.sdk:sdk_map:3.0.4'
implementation 'com.mapbox.mapboxsdk:mapbox-sdk-services:3.4.1'
implementation 'com.mapbox.mapboxsdk:mapbox-sdk-geojson:3.4.1'
implementation 'com.mapbox.mapboxsdk:mapbox-android-telemetry:3.5.7'
implementation 'com.mapbox.mapboxsdk:mapbox-android-gestures:0.3.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.squareup.okhttp3:okhttp:3.12.1'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'io.reactivex:rxandroid:1.2.1'
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
implementation 'ir.map.sdk:sdk_common:3.0.1'
implementation 'ir.map.sdk:sdk_services:3.0.7'

progaurd::::::::::::::::::::

-ignorewarnings

-dontwarn retrofit.**
-keep class retrofit.** { *; }
-keepattributes Signature
-keepattributes Exceptions

######github
-keepattributes Signature, Annotation, EnclosingMethod
-keep class almeros.android.multitouch.gesturedetectors.** { ; }
-keep class com.mapbox.mapboxsdk.
* { ; }
-keep interface com.mapbox.mapboxsdk.
* { ; }
-keep class com.mapbox.services.android.telemetry.
* { ; }
-keep class com.mapbox.services.commons.
* { ;}
-dontwarn android.support.
*
-dontwarn java.lang.**
-dontwarn org.codehaus.**
-keep class com.google.**
-dontwarn com.google.**
-dontwarn java.nio.**
-keep class android.support.v7.** { *; }
-keepattributes Signature, Annotation, EnclosingMethod
-dontobfuscate

Reflection on classes from native code

-keep class com.google.gson.JsonArray { *; }
-keep class com.google.gson.JsonElement { *; }
-keep class com.google.gson.JsonObject { ; }
-keep class com.google.gson.JsonPrimitive { ; }
-dontnote com.google.gson.

#unknown
-dontwarn com.google.**

dontnote for keeps the entry point x but not the descriptor class y

-dontnote ir.map.sdk_map.maps.MapboxMap$OnFpsChangedListener
-dontnote ir.map.sdk_map.style.layers.PropertyValue
-dontnote ir.map.sdk_map.maps.MapboxMap
-dontnote ir.map.sdk_map.maps.MapboxMapOptions
-dontnote ir.map.sdk_map.log.LoggerDefinition
-dontnote com.mapbox.android.core.location.LocationEnginePriority
-dontnote ir.map.sdk_map.offline.OfflineGeometryRegionDefinition

config for okhttp 3.11.0, square/okhttp#3354

-dontwarn okhttp3.**
-dontwarn javax.annotation.**
-dontnote okhttp3.internal.**
-dontwarn org.codehaus.**

config for mapbox-sdk-geojson:3.0.1

-keep class com.mapbox.geojson.** { ; }
-dontwarn com.google.auto.value.
*

config for additional notes

-dontnote org.robolectric.Robolectric
-dontnote libcore.io.Memory
-dontnote com.google.protobuf.**
-dontnote android.net.**
-dontnote org.apache.http.**

config for mapbox-sdk-services

while we don't include this dependency directly

a large amount of users combine it with our SDK

we aren't able to provide a proguard config in that project (jar vs aar)

-dontwarn com.sun.xml.internal.ws.spi.db.*

error::::::::
2019-08-26 17:31:51.738 4441-4441/? A/DEBUG: Build fingerprint: 'Android/vbox86p/vbox86p:9/PD1A.180720.031/22:userdebug/test-keys'
2019-08-26 17:31:51.738 4441-4441/? A/DEBUG: Revision: '0'
2019-08-26 17:31:51.738 4441-4441/? A/DEBUG: ABI: 'x86'
2019-08-26 17:31:51.739 4441-4441/? A/DEBUG: pid: 4407, tid: 4407, name: tar.iranbusdemo >>> com.example.sattar.iranbusdemo <<<
2019-08-26 17:31:51.740 4441-4441/? A/DEBUG: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
2019-08-26 17:31:51.740 4441-4441/? A/DEBUG: Abort message: '/usr/local/google/buildbot/src/android/ndk-release-r17/external/libcxx/../../external/libcxxabi/src/abort_message.cpp:73: abort_message: assertion "terminating with uncaught exception of type jni::PendingJavaException" failed'
2019-08-26 17:31:51.740 4441-4441/? A/DEBUG: eax 00000000 ebx 00001137 ecx 00001137 edx 00000006
2019-08-26 17:31:51.740 4441-4441/? A/DEBUG: edi 00001137 esi 00000000
2019-08-26 17:31:51.740 4441-4441/? A/DEBUG: ebp ffc99cc4 esp ffc99c58 eip e7739bc9
2019-08-26 17:31:51.992 4441-4441/? A/DEBUG: backtrace:
2019-08-26 17:31:51.992 4441-4441/? A/DEBUG: #00 pc 00000bc9 [vdso:e7739000] (__kernel_vsyscall+9)
2019-08-26 17:31:51.992 4441-4441/? A/DEBUG: #1 pc 0001fe08 /system/lib/libc.so (syscall+40)
2019-08-26 17:31:51.992 4441-4441/? A/DEBUG: #2 pc 00022e83 /system/lib/libc.so (abort+115)
2019-08-26 17:31:51.992 4441-4441/? A/DEBUG: #3 pc 00023338 /system/lib/libc.so (__assert2+56)
2019-08-26 17:31:51.992 4441-4441/? A/DEBUG: #4 pc 003a9b74 /data/app/com.example.sattar.iranbusdemo-n-gOUG0kag5hXnfAGzpV6w==/lib/x86/libmapbox-gl.so

can you help me?

@LukasPaczos
Copy link
Contributor

Hey @sattarsh, unfortunately, this tombstone doesn't provide much information. Could you create a small, standalone, project that reproduces the issue? Thank you!

@LukasPaczos LukasPaczos added Android Mapbox Maps SDK for Android needs information labels Aug 26, 2019
@pengdev
Copy link
Member

pengdev commented Sep 10, 2019

Tried building the test app in release build with proguard active and verified the test app still works as expected.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android needs information
Projects
None yet
Development

No branches or pull requests

3 participants