Warm tip: This article is reproduced from serverfault.com, please click

App crashes when downloaded from Google Play

发布于 2019-04-17 18:07:38

I've just built and deployed an app to Google Play. It worked well when I was running it through Android Studio but now it crashes when I download it from Google Play. Because this is my first time, I don't even know how to view the crash report/stacktrace of the app that was downloaded from Google Play. I appreciate any and all help.

UPDATE

So I got the stacktrace for the APK. It tells me that my TopImageFragment.java class cannot create my MemeViewModel.java class. I have no clue why its giving this error. Everything works fine as it is. It seems that proguard is indeed phasing out an important class:

2019-04-18 00:46:32.062 8099-8099/? E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.ozbek.onur.memegenerator, PID: 8099
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ozbek.onur.memegenerator/com.ozbek.onur.memegenerator.MainActivity}: java.lang.RuntimeException: Cannot create an instance of class com.ozbek.onur.memegenerator.MemeViewModel
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2853)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2928)
        at android.app.ActivityThread.-wrap11(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1609)
        at android.os.Handler.dispatchMessage(Handler.java:105)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6703)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:769)
     Caused by: java.lang.RuntimeException: Cannot create an instance of class com.ozbek.onur.memegenerator.MemeViewModel
        at android.arch.lifecycle.ViewModelProvider$NewInstanceFactory.create(ViewModelProvider.java:155)
        at android.arch.lifecycle.ViewModelProvider$AndroidViewModelFactory.create(ViewModelProvider.java:210)
        at android.arch.lifecycle.ViewModelProvider.get(ViewModelProvider.java:134)
        at android.arch.lifecycle.ViewModelProvider.get(ViewModelProvider.java:102)
        at com.ozbek.onur.memegenerator.TopImageFragment.onActivityCreated(TopImageFragment.java:89)
Questioner
Andros Adrianopolos
Viewed
0
oo92 2019-04-23 10:10:35

Check if you have any java files that don't have an access modifier. In my experience, just declaring a class without a public or private modifier, causes this problem.