Task ‘wrapper‘ not found in project ‘:example‘. 报错解决

在学习腾讯的开源跨端框架Hippy的时候

clone项目下来后

复制代码
git clone https://github.com/Tencent/Hippy.git

sync的时候遇到报错

Groovy 复制代码
Task 'wrapper' not found in project ':example'.

* Try:
> Run gradle tasks to get a list of available tasks.
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

然后一看这个目录里

居然都没有gradle/wrapper这个目录,于是我就把能正常跑起来的这个gradle/wrapper的东西复制过来了,

再sync,可以正常编译并运行了

总结一下解决方案是:

首先判断当前app模块下有没有gradle/wrapper目录,这个目录下有没有gradle-wrapper.jar和gradle-wrapper.properties文件,如果没有的话,就添加上述文件配置即可。

其中gradle-wrapper.properties文件内容如下:

Groovy 复制代码
#Fri Jun 21 19:49:00 CST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
相关推荐
2501_915909069 分钟前
全面解析iOS应用上架到App Store的完整流程与关键注意事项
android·macos·ios·小程序·uni-app·cocoa·iphone
淡淡的香烟2 小时前
AndroidAI使用心得
android
chjif3 小时前
Android 设备管控开发实战:无障碍如何准确识别当前前台 App?
android
chjif3 小时前
Android 设备管控开发实战:企业受控终端的 DNS 域名策略实现
android·华为·harmonyos
c238565 小时前
MySQL 基础用法(下):查询进阶与核心特性
android·c语言·c++·mysql
math_hongfan5 小时前
鸿蒙Agent高级技能自定义开发:自定义意图服务/能力注册/Agent技能编排/服务插件开发实战
android·学习·华为·harmonyos·鸿蒙
2501_915106326 小时前
iOS 证书类型及作用说明 账号证书与签名配置的完整解读
android·ios·小程序·https·uni-app·iphone·webview
九皇叔叔6 小时前
RHEL9 安装 MySQL 8.4.11.LTS 版本
android·mysql·adb
海兰6 小时前
【数据库】tdsql(MySQL )的事务隔离级别
android·数据库·mysql
哆啦A梦z7 小时前
Android BLE 实战:从小米手环 7 踩坑到完整连接框架
android