问题
I just launched my brand new app on Google Play but its crashing when i try to open it. The thing is, it used to work just fine in development.
I have ProGuard enabled and i tried disabling it, generating the signed apk and manually installing it on a device.. but my app still won't open.
Since i have Crittercism enabled, after a few tries, i finally got a crash to be reported to the website, and it says:
Unable to start activity ComponentInfo{com.pizzapp.android/com.pizzapp.android.login.PAWelcomeActivity}: java.lang.RuntimeException: java.lang.NoSuchMethodException: a(Activity,int)
PAWelcomeActivity is my main activity!
my proguard-project.txt is like:
-keepattributes SourceFile, LineNumberTable, Exceptions, Signature, InnerClasses
-keep class com.newrelic.** { *; }
-keep class com.facebook.** { *; }
-keep class com.parse.** { *; }
-dontwarn com.newrelic.**
Does anybody have an idea what this crash is?
Thanks, Newton
Update 1:
Here you can see how my package is organised:
回答1:
You are probably obfuscating the Activity lifecycle method names. Make sure not to do that.
回答2:
I finally solved it… the problem is that i forgot to add the ActionBarSherlock code for the proguard to work with it..
-keep class android.support.v4.app.** { *; }
-keep interface android.support.v4.app.** { *; }
-keep class com.actionbarsherlock.** { *; }
-keep interface com.actionbarsherlock.** { *; }
-keepattributes *Annotation*
来源:https://stackoverflow.com/questions/20818301/app-crashes-on-production-but-not-in-development