首页
找靠谱产品
找解决方案
找靠谱公司
找案例
找对的人
专家智库
悬赏任务
SAAS
ToB门户
了解全球最新的ToB事件
论坛
潜水/灌水快乐,沉淀知识,认识更多同行。
ToB圈子
加入IT圈,遇到更多同好之人。
微博
Follow
记录
Doing
博客
Blog
文库
业界最专业的IT文库,上传资料也可以赚钱
下载
分享
Share
排行榜
Ranklist
相册
Album
应用中心
qidao123.com ToB IT社区-企服评测·应用市场
»
论坛
›
软件与程序人生
›
移动端开发
›
[解决]Flutter打包Android是出现FAILURE: Build failed ...
返回列表
发新帖
[解决]Flutter打包Android是出现FAILURE: Build failed with an exception
[复制链接]
发表于 2025-2-26 00:37:15
|
显示全部楼层
|
阅读模式
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要
登录
才可以下载或查看,没有账号?
立即注册
×
1.问题出现
本日我更新完flutter以后发现Gradle 从7.3 升级到最低8.0,然后gradle-wrapper.properties 里面升级到8.3了,图片如下
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
# distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-8.3-all.zip
复制
代码
然后打包APK时出现一个问题,如下
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
Launching lib\main.dart on ASUS I003DD in debug mode...
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find androidx.lifecycle:lifecycle-common:2.7.0.
Searched in the following locations:
- https://maven.aliyun.com/nexus/content/repositories/google/androidx/lifecycle/lifecycle-common/2.7.0/lifecycle-common-2.7.0.pom
- https://maven.aliyun.com/repository/jcenter/androidx/lifecycle/lifecycle-common/2.7.0/lifecycle-common-2.7.0.pom
- https://maven.aliyun.com/repository/public/androidx/lifecycle/lifecycle-common/2.7.0/lifecycle-common-2.7.0.pom
- https://storage.flutter-io.cn/download.flutter.io/androidx/lifecycle/lifecycle-common/2.7.0/lifecycle-common-2.7.0.pom
Required by:
project :app > io.flutter:flutter_embedding_debug:1.0.0-db49896cf25ceabc44096d5f088d86414e05a7aa
> Could not find androidx.lifecycle:lifecycle-common-java8:2.7.0.
Searched in the following locations:
复制
代码
2.挖掘问题根源
我任意抓去一个链接访问看看,比如这个
https://maven.aliyun.com/nexus/content/repositories/google/androidx/lifecycle/lifecycle-common/2.7.0/lifecycle-common-2.7.0.pom
复制
代码
然后上阿里云的镜像网站搜刮这个工具 lifecycle-common
好家伙,阿里云还没更新2.7
版本
,最高2.6.1
版本
,所以我在build.gradle里屏蔽了阿里云,写了腾讯的
maven { url 'https://mirrors.tencent.com/nexus/repository/maven-public/' } // 腾讯云仓库
mavenCentral()
复制代码
3.解决问题
不出意外,这次乐成解决了
4.注意
gradle最小可以8.0开始,8.3换腾讯的源也下载很慢,耐心等待
回复
使用道具
举报
返回列表
浏览过的版块
DevOps与敏捷开发
数据仓库与分析
Java
SQL-Server
分布式数据库
网络安全
人工智能
IT职场那些事
.Net
物联网
南飓风
+ 我要发帖
登录后关闭弹窗
登录参与点评抽奖 加入IT实名职场社区
去登录
微信订阅号
微信服务号
微信客服(加群)
H5
小程序
快速回复
返回顶部
返回列表