Gradle error, could not create directory

Today we turn to such a problem when starting a test class using roboelectric and junit:

Information:Gradle: Executing tasks: [:app:assembleDebug, :app:assembleDebugUnitTest]
Error:Gradle: failed to create directory 'E:\AndroidKotlin\FooApp\app\build\generated\source\r\debug\com\example\foo\fooapp'
Error:Gradle: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.AaptException: AAPT2 link failed:
Error:Gradle: com.android.builder.internal.aapt.AaptException: AAPT2 link failed:
Error:Gradle: Execution failed for task ':app:processDebugResources'.
> Failed to execute aapt

Maybe someone met such an unpleasant thing before and it would be so nice to help me;)? If you have no idea, please let me know how I can try to find it myself. I already cleaned the project and rebuilt :)

+8
source share
4 answers

Finally, I managed to get rid of all the unwanted things with the AS option:

File -> Invalidate caches / Restart
+2
source

I met this error with Android Studio 3.0RC.
How to solve:
open (ctrl + shift + N): gradle.properties
add a line:android.enableAapt2=false

- : https://developer.android.com/studio/build/gradle-plugin-3-0-0.html

+16

, (SDK, Android Studio) (), . .

, , SDK Android Studio, .

Android Studio 3.0.1, compile SDK 27, Windows 10

+1

enter image description here

, , .

0

All Articles