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

眉间皱痕 提交于 2019-11-27 20:57:17

In my case the problem was that the name of the apk to be installed was cached, so everytime I tried running the app, an apk with today's date was generated but when installing, Android Studio looked for an apk file with an old name. The solution was to click Sync Gradle and then Build > Rebuild Project. You may also want to delete folders app/apks and app//build/outputs/apk previously.

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.

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.

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

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

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"
Subham Mishra

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!