today jump into such problem when launching 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 has meet such nasty thing earlier and would be so nice to help me ;) ? If u don't have any idea, please let me know how can I try finding it on my own. I already did clean project and rebuild :)
I solved it by changing the JDK version I was using:
Finally managed to get rid of all unwanted stuff with AS option:
File -> Invalidate caches / Restart
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With