在 AS 中运行 java 类报错

在 AS 中运行 java 类报错:

Error:Gradle: failed to create directory 'E:\jhrFile\SortApplication\app\build\generated\source\r\debug\com\example\sortapplication'.
Error:Gradle: java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:Gradle: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:Gradle: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:Gradle: Execution failed for task ':app:processDebugResources'.
> Failed to execute aapt

解决办法:
在项目的 gradle.properties 中添加 android.enableAapt2=false 即可

 

你可能感兴趣的:(AS报错解决方案)