Execution failed for task ':app:compileDebugJavaWithJavac'的小坑

一觉起来运行项目发现报错——Execution failed for task ‘:app:compileDebugJavaWithJavac’,之前也遇到过,具体怎么复现也不清楚,感觉像是AS闹脾气了..

《Execution failed for task ':app:compileDebugJavaWithJavac'的小坑》
《Execution failed for task ':app:compileDebugJavaWithJavac'的小坑》

提示缺失android.support.v7包,可import中显示已经导入。

解决方案:

在Terminal输入gradlew compileDebugJavaWithJavac,每个人检测出的问题可能不一样,有的是id找不到,有的是某些package没有导入/加载成功:

《Execution failed for task ':app:compileDebugJavaWithJavac'的小坑》
《Execution failed for task ':app:compileDebugJavaWithJavac'的小坑》

此时再转到对应的Activity,发现包可以重新导入,问题解决。

《Execution failed for task ':app:compileDebugJavaWithJavac'的小坑》

    原文作者:小懒的大白
    原文地址: https://www.jianshu.com/p/573c65733692
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞