EmptyThrowable: The APK file *.apk does not exist on disk

前端 未结 7 1438
忘掉有多难
忘掉有多难 2020-12-05 17:28

This is an Android application using gradle. After clicking Run, I found APP_V1.3.4_2016-02-22_11:30:29_google_pl

相关标签:
7条回答
  • 2020-12-05 17:32

    The reason is because Gradle is calculating the time twice - once when building the apk, then again while trying to install it.

    Do not calculate time again when you are creating the endFileName. Just do:

    def endFileName = time + "_${variant.productFlavors[0].name}.apk"
    
    0 讨论(0)
  • 2020-12-05 17:37

    In my case it was a problem for the android plugin version. i changed it from File->Project Structure->Project and changed the Android Plugin Version to any previous version. it may be any version of Android Studio. Basically Android Plugin Version is the version of your Android Studio Software version. It's not mandatory to keep the android plugin version same as android studio software version. you can give it any previous version of android studio you have installed.

    0 讨论(0)
  • 2020-12-05 17:37

    I have tried all the things like

    • Delete folders app/apks and app//build/outputs/apk previously
    • SyncGradle and Rebuild Project
    • lintOptions { abortOnError false }

    but got issue resolved by Clicking on Build>Build APK

    0 讨论(0)
  • 2020-12-05 17:37

    I had the same issue and nothing suggested above helped: neither clean/build nor restart Android Studio/PC. The problem was that there was locked file .gradle/buildOutputCleanup/cache.properties. Just removing cache.properties.LOCK file and then cleaning the project fixes the issue

    0 讨论(0)
  • 2020-12-05 17:47

    This happened on me because I removed all the "Extras" tools under "Standalone SDK Manager" and re-download the necessary tools only. *I'm not sure is this related to the problem or not.

    Anyway I tried both Sync Gradle and Rebuild Project doesn't solve the problems.

    EmptyThrowable: The APK file D:\...\outputs\apk\app-debug.apk does not exist on disk.

    I solved it by clicked:

    Build > Build APK

    Working solution for me.

    0 讨论(0)
  • 2020-12-05 17:48

    Restarting Android Studio worked for me. Hopefully same will work for you. Else have a look at below link. The APK file does not exist on disk

    Edit- If this doesn't work , use Invalidate Cache / Restart in File menu. Hope this helps.

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