Event log里面显示的是Gradle syn failed
logcat里面显示的有6个错误
Error:resource style/Base.V26.Widget.Design.AppBarLayout (aka com.example.reshangkeji.ydc:style/Base.V26.Widget.Design.AppBarLayout) not found.
Error:failed linking references.
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
Error:failed linking references.
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
开始以为是项目的原因,然后重新建立了项目依旧报这个错误,所以是AS自身的原因
在网上查了一下发现是Gradle更新的原因,AS3.0不支持Gradle3.0.1
在项目的build.gradle中的把3.0.1改成3.0.0,然后点击上方sync now重新加载。加载完成后AS会提示你是否更新gradle,直接忽略。
这样以后,就没问题了项目可以重新运行在虚拟机了~~~