一、问题描述
晚上在Android Studio上,切换分支之后,重新编译运行的时候,报错了,错误信息如下所示:
错误信息文本:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':p_imphone:packageDebugResources'.
> D:\GitLab Source\XTCWatch_TalentAccount\XTCWatch\p_imphone\src\main\res\values\strings.xml: Error: In DataSet 'main', no data file for changedFile. This is an internal error in the incremental builds code; to work around it, try doing a full clean build.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 27s
74 actionable tasks: 30 executed, 44 up-to-date
二、解决错误
如上所示,提示我们要想编译成功,得先来一遍完全的clean,因为切换分支之前,有其他分支编译的产物影响了切换分支之后的编译。
Error: In DataSet 'main', no data file for changedFile. This is an internal error in the incremental builds code; to work around it, try doing a full clean build.
-
执行 gradlew clean 命令
在这里插入图片描述
-
重新编译
clean成功之后,再次编译的话就成功了,如下所示:
作者:欧阳鹏 欢迎转载,与人分享是进步的源泉!
转载请保留原文地址:https://blog.csdn.net/ouyang_peng/article/details/83626004
如果本文对您有所帮助,欢迎您扫码下图所示的支付宝和微信支付二维码对本文进行打赏。






网友评论