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;