The .apk file does not exist on disk, but it does

Whenever I debug an application, an error appears that ... .apk file does not exist on a disk and the application does not start.

After updating Android Studio, this error started.

I searched for different solutions after a lot of searching. It includes:

  • Downgrade Android Studio (it starts to give plugins, and I don’t want to not use the new Android studio)
  • Tried this solution without any luck.
  • This is where the power problem is different, but with a possible solution to my problem. That didn't work either.
  • Link to issue

Any help would be appreciated.

+5
source share
2 answers

Check your path to your apk. Folder names may have special characters. It also causes adb to get through this error.

+2
source

If you have something like this in the build.gradle file:

 applicationVariants.all { variant -> variant.outputs.each { output -> output.outputFile = new File(output.outputFile.parent, baseFilename + defaultConfig.versionCode + "_" + defaultConfig.versionName + "_" + getDate() + ".apk") } } 

And this one

 def getDate() { def date = new Date() def formattedDate = date.format('dd.MM.yyyy') return formattedDate } 

You must remove getDate () from the output to fix your problem. Take a look at this post.

+6
source

Source: https://habr.com/ru/post/1257432/


All Articles