简体   繁体   中英

How to enable ProGuard with Crashlytics?

Before installing Crashlytics the project.properties file was used to enable ProGuard by uncommenting this line:

proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

After installing Crashlytics the project.properties file now has a comment saying that the project.properties file is managed by Fabric and the ProGuard line is no longer there.

I've tried researching how to enable ProGuard and have not found an answer yet. I'm using Eclipse and I exported my project using the following:

File -> Export -> Android -> Export Crashlytics-enabled Android Application

I also tried adding these lines to proguard-project.txt:

-keep class com.crashlytics.** { *; }
-keep class com.crashlytics.android.**
-keepattributes SourceFile,LineNumberTable *Annotation*

I used dex2jar to obtain the source code from the APK and the code wasn't obfuscated.

Any help in getting ProGuard to work with Crashlytics would be greatly appreciated. Thanks!

Try This ProGuard rules

# Crashlytics
-keep class com.crashlytics.** { *; }
-dontwarn com.crashlytics.**
-keepattributes SourceFile,LineNumberTable,*Annotation*
-keep class com.crashlytics.android.**

According with this question.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM