0

My Android App works fine in Emulator and on physical devices connected to the computer, but it (app) crashes when APK installed through Google Drive on the same device.

My app has two activities: Main and Game Play. On the main screen (activity) there is a Play button that starts the second activity (game play). I have a physical device (Galaxy Tab E) connected to my computer. When I test my app on the emulator and on the physical device, the app works fine without any problems. However, when I generate an APK for Google Play Store and uploading it on my Google Drive, and installing it on the same physical device, it crashes when I click/tap the Play button. Don't know how to debug it and I don't know what am I missing. Is there any difference between Android Studio package that tests on the emulator and the generated apk?

I don't know how to get any generated error to add here for troubleshooting, as the device is not connected to the computer.

I expect the APK to work exactly as on the emulator or USB-connected device. Any help is greatly appreciated.

Edit: After connecting the cable, I got the following errors when pressing the Play button:

08-15 12:15:23.762 14689-14689/? E/AndroidRuntime: FATAL EXCEPTION: main
    Process: ca.simapp.kids, PID: 14689
    java.lang.VerifyError: c/b/b/a/e/a/VJ
        at c.b.b.a.e.a._J.f()
        at c.b.b.a.e.a._m.a()
        at c.b.b.a.e.a.oD.a(:16)
        at c.b.b.a.e.a.CZ.a(:3)
        at ca.simapp.kids.Game.onCreate(:5)
        at android.app.Activity.performCreate(Activity.java:5447)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2393)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2493)
        at android.app.ActivityThread.access$800(ActivityThread.java:166)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1283)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:136)
        at android.app.ActivityThread.main(ActivityThread.java:5584)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:515)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
        at dalvik.system.NativeStart.main(Native Method)
08-15 12:15:24.083 588-14754/? E/android.os.Debug: !@Dumpstate > sdumpstate -k -t -z -d -m 14689 -o /data/log/dumpstate_app_error
08-15 12:15:25.994 588-666/? E/ViewRootImpl: sendUserActionEvent() mView == null
08-15 12:15:26.105 588-721/? E/InputDispatcher: channel ~ Channel is unrecoverably broken and will be disposed!
08-15 12:15:31.720 170-420/? E/audio_hw_primary: select_devices_signal starting... adev->out_devices 0x2 adev->in_devices 0x0
08-15 12:15:33.101 588-990/? E/WifiService: SEC_COMMAND_ID_SET_WIFI_SCAN_WITH_P2P : Start scan, start assoc
08-15 12:15:39.197 170-420/? E/audio_hw_primary: select_devices_signal starting... adev->out_devices 0x2 adev->in_devices 0x0

Line 5 in the error points to

import android.content.SharedPreferences;

user258959
  • 91
  • 6
  • 1
    plug your device into the computer and look at the logcat output in android studio for the crash – tyczj Aug 15 '19 at 15:23
  • It is debug build for both ? if yes then loke at logcat. I think may be issue in layout. – Bhaven Shah Aug 15 '19 at 15:44
  • @tyczj Thanks for the suggestion. I assumed, wrongly, that if an app is not installed through Android Studio, it wouldn't show the errors. After connecting the cable, the log cat showed the above (main post) error. Still don't know how to fix it. – user258959 Aug 15 '19 at 16:21
  • @Bhaven Shah, No, it's final Generated apk to be submitted to Google Play store. It works perfectly fine in the same device through the Android Studio Play button, but not through Google Drive. – user258959 Aug 15 '19 at 16:23

1 Answers1

0

Hi check this link it seems that some classes has changed between compile and runtime. Now i would suggest to debug by adding and removing libraries which you suspect and create APKs to see which one is causing the error. And keep internet connection proper so you don't get obfuscated log messages.

BTW you can still read obfuscated log using proguard file use that to find the name of the class causing error.

Bali
  • 749
  • 6
  • 19
  • I can't find a very clear solution there. Everybody talks about Library, but no one mentions where to find it or how to change it. I'm thinking of uninstalling Android Studio along with all sdks etc to see if that helps. – user258959 Aug 29 '19 at 23:47