Android App Crashes on Real Device If apk is manually installed

后端 未结 4 490
时光说笑
时光说笑 2020-12-31 10:47

My Application is running fine in Emulators and even in real devices installed by android studio for debugging purpose, but it is crashing if installed manually using apk fi

相关标签:
4条回答
  • 2020-12-31 11:22

    If you just upgraded your android studio.

    You will not have this option to disable -> Instant Run. (not on the menu)

    Seems like with new android studio and gradle upgrade in order to install an apk you need to properly build it.

    Option 1: with gradle from command line

    ./gradlew :appName:clean  
    ./gradlew :appName:build
    

    Option 2: from android studio

    Android Studio -> build -> build APK (or generate sighed APK)

    The generated apk can be installed fine on a device.

    Note: if you start a new applicate with this version of android studio you will see that when you run from studio there is no apk generated anymore.

    0 讨论(0)
  • 2020-12-31 11:27

    I faced the similar problem.

    Note the size of Apk, it would be very small in size , this is because of the instant run feature in enabled. Just disable it

    May be Android Studio is not including all files in Apk, when we use the instant run to fasten the process.

    Any body know why this happening?

    Go to :

    Android Studio --> File --> Setting --> Build, execution, deploy --> Instant run.
    
    0 讨论(0)
  • 2020-12-31 11:36

    Just go to:

    Android Studio --> File --> Setting --> Build, execution, deploy --> Instant run.
    

    and disable instant run.

    0 讨论(0)
  • 2020-12-31 11:43

    Android Studio --> File --> Setting --> Build, execution, deploy --> Instant run. and disable instant run.

    0 讨论(0)
提交回复
热议问题