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
相关推荐
00后程序员张1 天前
对比 Ipa Guard 与 Swift Shield 在 iOS 应用安全处理中的使用差异
android·开发语言·ios·小程序·uni-app·iphone·swift
悠哉清闲1 天前
不同车型drawable不同
android·开发语言
00后程序员张1 天前
在 iOS 设备上同时监控 CPU、GPU 与内存的方法
android·ios·小程序·https·uni-app·iphone·webview
测试_AI_一辰1 天前
项目实践笔记 9:打卡/日报Agent项目Bug 修改与稳定性收口(v1.0)
android·开发语言·人工智能·功能测试·ai编程·ab测试
马 孔 多 在下雨1 天前
Kotlin协程进阶王炸之作-Kotlin的协程到底是什么
android·开发语言·kotlin
冬奇Lab1 天前
【Kotlin系列15】多平台开发实战:一次编写,多端运行
android·开发语言·kotlin
Dxy12393102161 天前
告别默认排序:MySQL自定义排序的“炼金术”
android·数据库·mysql
请叫我大虾1 天前
发现一个jdk中ArrayList的小BUG
android·java·bug
一起养小猫1 天前
Flutter for OpenHarmony 实战:双控制系统实现(按钮+键盘)
android·flutter·计算机外设·harmonyos
_李小白1 天前
【Android 美颜相机】第十八天:GPUImageChromaKeyBlendFilter 解析
android·数码相机