原创

androidstudio-gradle-Aapt2Exception编译异常-AAPT2-PreferenceScreen-ExecutionException

Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar]
D:\workspace\AndroidStudio\CompanyProjects\projects\SuJianAn\app\build\intermediates\manifests\full\debug\AndroidManifest.xml
Error:(65) error: unknown element <PreferenceScreen> found.
Error:(65) unknown element <PreferenceScreen> found.
Error:java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception:

AAPT2 error: check logs for details
Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:Execution failed for task ':app:processDebugResources'.
> Failed to execute aapt
Information:BUILD FAILED in 2s
Information:6 errors

解决方案
只需在工程的gradle.properties文件中添加以下命令:

android.enableAapt2=false
正文到此结束
本文目录