App crashes on production but not in development

柔情痞子 提交于 2019-12-13 04:37:23

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!