Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execution failed for task ':app:packageDebug'. Cannot create directory

Tags:

android

when I update my android studio to 3.0 beta7 ,Build failed with an exception.

  • What went wrong: Execution failed for task ':app:packageDebug'. Cannot create directory F:\project\ my project path \app\build\outputs\apk\debug

And I clear the cache,restart the computer and android studio,but it does not work at all,what should I do right now?

I kill process Java(TM) Platform SE binary ,and delete build cache ,it does not work either

like image 381
Nihility H Avatar asked Dec 07 '22 16:12

Nihility H


2 Answers

I got solution from here Migrate to Android Plugin for Gradle 3.0.0

android.applicationVariants.all { variant ->
    variant.outputs.all {
        outputFileName = "${variant.name}-${variant.versionName}.apk"
    }
}
like image 91
Bhavesh Hirpara Avatar answered May 23 '23 15:05

Bhavesh Hirpara


This worked for me!

1. Open app.graddle file, and replace in applicationVariants.all... with

android.applicationVariants.all { variant ->
        variant.outputs.all {
            outputFileName = "${variant.name}-${variant.versionName}.apk"
        }
    }

2. Build-> Make project
3. Then Generate your signed APK

like image 44
charles gatama Avatar answered May 23 '23 16:05

charles gatama