Application Installation Failed in Android Studio

后端 未结 30 2280
情书的邮戳
情书的邮戳 2020-11-28 02:02

Yesterday my app was running perfect from Android Studio but today when I started working on my app and running it i am getting error message continuously

相关标签:
30条回答
  • 2020-11-28 02:22

    I had the same issue in Android studio 2.3 when I tried to test the app using Xiaomi's Mi5 and Mi4 phones. Disabling instant run didn't help me. So here is what I did.

    Turn Off MIUI optimization in the Developer Options in the phone.
    


    Then the device will be rebooted and then you'll be able to test the app over the phone.

    Using this method you can still use instant run option in android studio. So this will fix your problem at least temporary. Hope that we'll be able to use MIUI optimization in the near future updates :)

    0 讨论(0)
  • 2020-11-28 02:22

    Go to USB Debugging and disable MIUI Inspection and allow the phone to reboot. Things should be fine from here

    0 讨论(0)
  • 2020-11-28 02:23

    Finally I've SOLVED it!

    Below a temporary solution. Issue was reported to Google.

    First of all I found in Run log that Android Studion 2.3 tries to install app-debug.apk from many slices, like this:

    $ adb install-multiple -r E:\Android_Projects\ActivityLifecycle\app\build\intermediates\split-apk\debug\slices\slice_1.apk E:\Android_Projects\ActivityLifecycle\app\build\intermediates\split-apk\debug\dep\dependencies.apk E:\Android_Projects\ActivityLifecycle\app\build\intermediates\split-apk\debug\slices\slice_0.apk E:\Android_Projects\ActivityLifecycle\app\build\intermediates\split-apk\debug\slices\slice_2.apk E:\Android_Projects\ActivityLifecycle\app\build\intermediates\split-apk\debug\slices\slice_9.apk E:\Android_Projects\ActivityLifecycle\app\build\intermediates\split-apk\debug\slices\slice_4.apk E:\Android_Projects\ActivityLifecycle\app\build\intermediates\split-apk\debug\slices\slice_3.apk E:\Android_Projects\ActivityLifecycle\app\build\intermediates\split-apk\debug\slices\slice_5.apk E:\Android_Projects\ActivityLifecycle\app\build\intermediates\split-apk\debug\slices\slice_8.apk E:\Android_Projects\ActivityLifecycle\app\build\intermediates\split-apk\debug\slices\slice_7.apk E:\Android_Projects\ActivityLifecycle\app\build\intermediates\split-apk\debug\slices\slice_6.apk E:\Android_Projects\ActivityLifecycle\app\build\outputs\apk\app-debug.apk

    Then I tried to install only app-debug.apk from command line by:

    adb install -d E:\Android_Projects\ActivityLifecycle\app\build\outputs\apk\app-debug.apk

    App was installed successfully but was failed to run on my phone.

    And finally:

    1. I recompiled app-debug.apk from command line as:

    gradlew.bat assembleDebug

    1. Repeat installation of app-debug.apk from command line and became happy:

    adb install -rd E:\Android_Projects\ActivityLifecycle\app\build\outputs\apk\app-debug.apk

    This is definitely some gradle problem in AndroidStudio 2.3.

    0 讨论(0)
  • 2020-11-28 02:25

    I also had the problem after globally changing the project name, applicationid and the folders containing the java files.

    Disabling Instant run helped, but was not a good option, so this helped:

    • close Android Studio
    • deleted those files and folders: rm -Rf .gradle .tags local.properties .idea/workspace.xml .idea/caches/* .idea/libraries app/build
    • start Android Studio and let it resync everything
    • press run
    0 讨论(0)
  • 2020-11-28 02:25

    For me I had to close the emulator and then select cold boot when re-opening it.

    0 讨论(0)
  • 2020-11-28 02:26

    In my case, it was because my emulator ran out of disk space.

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