简体   繁体   中英

Android Beta app crashes when opening from Playstore (but works otherwise)

New developer here.

I just recently finished an app I'm working on, and published it as a beta version to the Play Store. Before sending this to my beta testers, I sent a link to myself just to see if it works. When I clicked the link and installed the app from the Play Store it appears to have loaded to my device just fine. But then when I open the app, it crashes before it even opens. I get an "Unfortunately, App Name has stopped" message.

Just to double check and make certain I didn't mess anything up last minute before publishing, I uninstalled and ran the app from my device using Android Studio and it runs just fine.

The only thing I can think may be causing this are a few things I did before building the APK.

First, in my build.gradle file I inserted "optimize" to this line of code:

buildTypes {
        release {
            runProguard true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

Then in the proguard-rules.pro I added the following:

-assumenosideeffects class android.util.Log {
    public static boolean isLoggable(java.lang.String, int);
    public static int v(...);
    public static int i(...);
    public static int w(...);
    public static int d(...);
    public static int e(...);
}
-ignorewarnings

The "assumenosideeffects" line - as I understand it - is to weed out my Logs so they don't run in the Play Store version.

I added the "ignorewarnings" line because on building the APK, I got 78 (yellow) warnings, all of which had to do with Facebook. But I have no facebook integration and never even attempted to write any code to integrate facebook. So I assumed that adding the ignorewarnings line wouldn't impede the function of the app. Was I mistaken?

So that's my problem. Any ideas what the isue may be?

Thanks so much for your help. I have benefited a lot from this community, and I appreciate it so much :)

EDIT

Stack Trace is below:

java.lang.RuntimeException: Unable to create application com.offyear.www.offyear.Application: java.lang.IllegalArgumentException: Default constructor for class com.a.lb is not accessible.
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4447)
at android.app.ActivityThread.access$1300(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalArgumentException: Default constructor for class com.a.lb is not accessible.
at com.a.gy.c(Unknown Source)
at com.a.gy.C(Unknown Source)
at com.a.ed.a(Unknown Source)
at com.offyear.www.offyear.Application.onCreate(Unknown Source)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4444)
... 10 more

OK, not really sure what the source of the problem was, but I did finally resolve the issue - figured I'd post it in case anyone else runs into similar trouble.

Apparently something in the proguard code was messing things up. So I just deleted all the proguard code, set runProguard to false in gradle and deleted "optimize."

App installed and ran from Google Play with no problem after that.

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