Ionic解决Could not read build file capacitor/build.gradle as it does notexist.问题
Ionic项目以前运行的好好的,今天编译android突然出现以下报错。
A problem occured configuring project ':capacitor android'. > Could not read build file [email protected]/android/capacitor/build.gradle' as it does not exist. * Try: Run with --info or --debug option to get more log output. Run with --scan to get full insigns. * Exception is: org.gradle.api.ProjectConfigurationException: A problem occured configuring project ':capacitor android'.<1111 internal calls> Caused by: org.gradle.api.resource.MissingResourceException: Could not read build file [email protected]/android/capacitor/build.gradle' as it does not exist. ...107 more
解决办法
首先检查node_module中的android模块的build.gradle
是否存在,如果确实存在,只能重新生成。
- 删除node_module中的
@capacitor
依赖库。 - 使用命令
npm install @capacitor/core @capacitor/cli
重新生成@capacitor
目录 - 在Android Studio中关闭项目,返回到Welcome的界面。将项目从左侧列表中移除,然后点击右侧的Open an Existing Project重新打开项目,再次编译就能正常识别
build.gralde
了。
声明:
1. 本站所有文章教程及资源素材均来源于网络与用户分享或为本站原创,仅限用于学习和研究。
2. 如果内容损害你的权益请联系客服QQ:1642748312给予处理。
码云笔记 » Ionic解决Could not read build file capacitor/build.gradle as it does notexist.问题
1. 本站所有文章教程及资源素材均来源于网络与用户分享或为本站原创,仅限用于学习和研究。
2. 如果内容损害你的权益请联系客服QQ:1642748312给予处理。
码云笔记 » Ionic解决Could not read build file capacitor/build.gradle as it does notexist.问题