Developer
Developer

Reputation: 157

“Force Close Application” after enabling Proguard

It was a working app with out Proguard But now, i enabled Proguard and Exported the signed app using Android-Tools > Export signed application

Then i copied this .apk on to the SD card and tried to install on the Device. But the application stopped working

My Proguard.cfg code :

-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-verbose


-dontoptimize
-dontpreverify


-keepattributes *Annotation*
-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.app.backup.BackupAgent
-keep public class * extends android.preference.Preference
-keep public class * extends android.support.v4.app.Fragment
-keep public class * extends android.app.Fragment

-keepclasseswithmembernames class * {
    native <methods>;
}

-keep public class * extends android.view.View {
    public <init>(android.content.Context);
    public <init>(android.content.Context, android.util.AttributeSet);
    public <init>(android.content.Context, android.util.AttributeSet, int);
    public void set*(...);
}

-keepclasseswithmembers class * {
    public <init>(android.content.Context, android.util.AttributeSet);
}

-keepclasseswithmembers class * {
    public <init>(android.content.Context, android.util.AttributeSet, int);
}

-keepclassmembers class * extends android.app.Activity {
   public void *(android.view.View);
}

-keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}

-keep class * implements android.os.Parcelable {
  public static final android.os.Parcelable$Creator *;
}

-keepclassmembers class **.R$* {
    public static <fields>;
}


-dontwarn android.support.**
-dontwarn org.acra.**
-dontwarn com.google.**
-dontwarn com.jeremyfeinstein.**

i am using sliding menu and google analyic and acra crash report .Any help would be greatly appreciated.

Upvotes: 2

Views: 555

Answers (1)

Developer
Developer

Reputation: 157

I solved my problem with the following cod: I added cod to the file Proguard.cfg:

-dontwarn org.acra.**
-keep class org.acra.** { *; }
-dontwarn com.google.**
-keep class com.google.analytics.tracking.android.** { *; }
-dontwarn com.jeremyfeinstein.**
-keep class com.jeremyfeinstein.slidingmenu.lib.** { *; }

Upvotes: 1

Related Questions