You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
[android] config proguard-rules.pro file for release #8931
changed the title [-][android] when use mapbox sdk, how to config proguard-rules.pro file for release[/-][+][android] when app use mapbox sdk, how to config proguard-rules.pro file for release[/+]on May 9, 2017
@Larnoo thank you for this question, we package a proguard configuration file in the SDK. You activate it with using the following in your build.gradle:
@tobrun
Just for clarification - 5.0.2 works like a charm (proguard).
Actually I've tried last beta version 5.1.0-beta.1 and there was a problem on start (crash) - are you sure nothing has changed? If it's required I can check for logs.
changed the title [-][android] when app use mapbox sdk, how to config proguard-rules.pro file for release[/-][+][android] config proguard-rules.pro file for release[/+]on May 9, 2017
Looking at the mapping.txt, currently nothing from our proguard configuration is picked up anymore.
This was a misconfiguration in gradle, consumer proguard was only activated for release builds.
My app crashes when using proguard with version 5.1.0.beta.3 or snapshot, working fine with 5.0.2. Error:
A/libc: /usr/local/google/buildbot/src/android/ndk-r13-release/external/libcxx/../../external/libcxxabi/src/abort_message.cpp:74: void abort_message(const char *, ...): assertion "terminating with uncaught exception of type jni::PendingJavaException" failed
A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 742
# General
-keepattributes Signature
-keepattributes Exceptions
-keepattributes *Annotation*
-keepattributes EnclosingMethod
# Javascript
-keepattributes JavascriptInterface
-keepclassmembers class * {
@android.webkit.JavascriptInterface <methods>;
}
# Glide
-keep public class * implements com.bumptech.glide.module.GlideModule
-keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
**[] $VALUES;
public *;
}
# Retrofit
-dontnote retrofit2.Platform # Platform calls Class.forName on types which do not exist on Android to determine platform.
-dontnote retrofit2.Platform$IOS$MainThreadExecutor # Platform used when running on RoboVM on iOS. Will not be used at runtime.
-dontwarn retrofit2.Platform$Java8 # Platform used when running on Java 8 VMs. Will not be used at runtime.
# OkHttp 3
-keep class okhttp3.** { *; }
-keep interface okhttp3.** { *; }
-dontwarn okhttp3.**
# Okio
-keep class sun.misc.Unsafe { *; }
-dontwarn java.nio.file.*
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
-dontwarn okio.**
# App compat
-keep public class android.support.v7.widget.** { *; }
-keep public class android.support.v7.internal.widget.** { *; }
-keep public class android.support.v7.internal.view.menu.** { *; }
-keep public class * extends android.support.v4.view.ActionProvider {
public <init>(android.content.Context);
}
# Butterknife
-keep public class * implements butterknife.Unbinder { public <init>(**, android.view.View); }
-keep class butterknife.*
-keepclasseswithmembernames class * { @butterknife.* <methods>; }
-keepclasseswithmembernames class * { @butterknife.* <fields>; }
# Joda time
-dontwarn org.joda.convert.**
-dontwarn org.joda.time.**
-keep class org.joda.time.** { *; }
-keep interface org.joda.time.** { *; }
# Unity
-dontwarn com.androidnative.**
-keep public class com.unity.plugins.** { *; }
-keep class com.unity3d.** { *; }
-keep class bitter.jnibridge.** { *; }
-keep class org.fmod.** { *; }
# Billing
-keep class com.android.vending.billing.**
@tobrun at the very least -keep class com.google.gson.** { *; } might be needed for your config.
I'm working on the upgrade to 5.1 and it seems that the sdk is accessing these gson classes as part of the new strategy for handling modifying geojson?
Activity
[-][android] when use mapbox sdk, how to config proguard-rules.pro file for release[/-][+][android] when app use mapbox sdk, how to config proguard-rules.pro file for release[/+]tobrun commentedon May 9, 2017
@Larnoo thank you for this question, we package a proguard configuration file in the SDK. You activate it with using the following in your build.gradle:
mpuchala commentedon May 9, 2017
@tobrun
Just for clarification - 5.0.2 works like a charm (proguard).
Actually I've tried last beta version 5.1.0-beta.1 and there was a problem on start (crash) - are you sure nothing has changed? If it's required I can check for logs.
tobrun commentedon May 9, 2017
Thank you for the report @mpuchala, going to use this issue to track it for 5.1.0 release.
[-][android] when app use mapbox sdk, how to config proguard-rules.pro file for release[/-][+][android] config proguard-rules.pro file for release[/+]tobrun commentedon May 9, 2017
pinpointed the native crash to
ConnectivityReceiver.instance(appContext);inMapbox.java.tobrun commentedon May 9, 2017
Looking at the mapping.txt, currently nothing from our proguard configuration is picked up anymore.This was a misconfiguration in gradle, consumer proguard was only activated for release builds.
tobrun commentedon May 15, 2017
This landed in #8944 to the release branch, closing
mare011 commentedon May 30, 2017
My app crashes when using proguard with version 5.1.0.beta.3 or snapshot, working fine with 5.0.2.
Error:
A/libc: /usr/local/google/buildbot/src/android/ndk-r13-release/external/libcxx/../../external/libcxxabi/src/abort_message.cpp:74: void abort_message(const char *, ...): assertion "terminating with uncaught exception of type jni::PendingJavaException" failed
A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 742
tobrun commentedon Jun 1, 2017
@mare011
I'm not running in any proguard issues using the test app. Are you hooking into the "default" proguard config?
For the reference this is the config I'm using in the test app:
Without having more information, I'm not able to look into this more. Closing as non reproducible.
mare011 commentedon Jun 2, 2017
Sorry, i thought it wasn't app specific, cause it's working with 5.0.2, here's the config:
Rules:
tobrun commentedon Jun 2, 2017
@mare011 what happens if you add the following to that config?
mare011 commentedon Jun 2, 2017
@tobrun This line helped: -keep class com.google.**
tobrun commentedon Jun 2, 2017
a great @mare011! afaik this isn't something that we should include in our config. Thank you for following up!
mare011 commentedon Jun 2, 2017
No problem.
sddamico commentedon Jul 14, 2017
@tobrun at the very least
-keep class com.google.gson.** { *; }might be needed for your config.I'm working on the upgrade to 5.1 and it seems that the sdk is accessing these gson classes as part of the new strategy for handling modifying geojson?