在打包APK使用Proguard的話,有可能會出現錯誤
解決的辦法就是在Proguard.cfg中加上忽略Crashlytics和Fabric相關Jar的語法,如下
-keep class io.fabric.sdk.android.** { *; } -keep interface io.fabric.sdk.android.** { *; } -keep class com.digits.sdk.android.core.** { *; } -keep interface com.digits.sdk.android.core.** { *; } -keep class com.twitter.sdk.android.** { *; } -keep interface com.twitter.sdk.android.** { *; } -keep public class * extends android.app.Activity -keep public class * extends android.app.Application -keep public class * extends android.app.Service -keep public class * extends android.content.BroadcastReceiver -keep public class * extends android.content.ContentProvider -keep public class * extends android.preference.Preference -keep public class * extends android.support.v4.app.Fragment -keep public class com.android.vending.billing.IInAppBillingService -keep class io.fabric.** { *; } -keep interface io.fabric.** { *; } -keep class com.digits.** { *; } -keep interface com.digits.** { *; } -keep class com.twitter.** { *; } -keep interface com.twitter.** { *; } -keep class com.crashlytics.** { *; } -keep interface com.crashlytics.** { *; }
這樣就可以順利的打包了
沒有留言:
張貼留言