文章目录

  • 一、 报错信息
  • 二、 解决方案
  • 三、 备选方案

一、 报错信息


从网上下载了一个 Flutter 工程代码 , 打开时 , 报如下错误 ;

Launching lib\main.dart on Pixel 2 in debug mode...
Running Gradle task 'assembleDebug'...FAILURE: Build failed with an exception.* What went wrong:
Could not determine the dependencies of task ':app:preDebugBuild'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.> Could not resolve io.flutter:flutter_embedding_debug:1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c.Required by:project :appproject :app > project :image_pickerproject :app > project :url_launcher> Could not resolve io.flutter:flutter_embedding_debug:1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c.> Could not get resource 'https://jcenter.bintray.com/io/flutter/flutter_embedding_debug/1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c/flutter_embedding_debug-1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c.pom'.> Could not HEAD 'https://jcenter.bintray.com/io/flutter/flutter_embedding_debug/1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c/flutter_embedding_debug-1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c.pom'. Received status code 500 from server: Internal Server Error> Could not resolve io.flutter:arm64_v8a_debug:1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c.Required by:project :app> Could not resolve io.flutter:arm64_v8a_debug:1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c.> Could not get resource 'https://jcenter.bintray.com/io/flutter/arm64_v8a_debug/1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c/arm64_v8a_debug-1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c.pom'.> Could not HEAD 'https://jcenter.bintray.com/io/flutter/arm64_v8a_debug/1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c/arm64_v8a_debug-1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c.pom'. Received status code 500 from server: Internal Server Error> Could not resolve io.flutter:x86_debug:1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c.Required by:project :app> Could not resolve io.flutter:x86_debug:1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c.> Could not get resource 'https://jcenter.bintray.com/io/flutter/x86_debug/1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c/x86_debug-1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c.pom'.> Could not HEAD 'https://jcenter.bintray.com/io/flutter/x86_debug/1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c/x86_debug-1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c.pom'. Received status code 502 from server: Bad Gateway> Could not resolve io.flutter:x86_64_debug:1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c.Required by:project :app> Could not resolve io.flutter:x86_64_debug:1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c.> Could not get resource 'https://jcenter.bintray.com/io/flutter/x86_64_debug/1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c/x86_64_debug-1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c.pom'.> Could not HEAD 'https://jcenter.bintray.com/io/flutter/x86_64_debug/1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c/x86_64_debug-1.0.0-e1e6ced81d029258d449bdec2ba3cddca9c2ca0c.pom'. Received status code 502 from server: Bad Gateway* Try:
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.* Get more help at https://help.gradle.orgBUILD FAILED in 4s
Finished with error: Gradle task assembleDebug failed with exit code 1

二、 解决方案


在 Flutter 工程下的 android/build.gradle 下进行如下配置 :

在 repositories 配置如下源 : 注释掉 google()jcenter() , 并添加如下代码 , 其它配置不用动 ;

maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
maven { url "http://download.flutter.io" }

完整代码如下 :

buildscript {repositories {//google()//jcenter()maven { url 'https://maven.aliyun.com/repository/google' }maven { url 'https://maven.aliyun.com/repository/jcenter' }maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }maven { url "http://download.flutter.io" }}dependencies {classpath 'com.android.tools.build:gradle:3.3.0'}
}allprojects {repositories {//google()//jcenter()maven { url 'https://maven.aliyun.com/repository/google' }maven { url 'https://maven.aliyun.com/repository/jcenter' }maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }maven { url "http://download.flutter.io" }}
}rootProject.buildDir = '../build'
subprojects {project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {project.evaluationDependsOn(':app')
}task clean(type: Delete) {delete rootProject.buildDir
}

使用上述方案已解决问题 ;

三、 备选方案


( 该方案没有经过测试 )

在 flutter\packages\flutter_tools\gradle\resolve_dependencies.gradle 中 ,

添加如下代码 :

maven {url 'http://download.flutter.io'
}

注意添加位置 :

repositories 添加后的配置 :

repositories {google()jcenter()maven {url "$storageUrl/download.flutter.io"}maven {url 'http://download.flutter.io'}
}

【错误记录】Flutter 报错 ( Could not resolve io.flutter:flutter_embedding_debug:1.0.0. )相关推荐

  1. 报错:Cannot resolve org.openjfx:javafx.base:11.0.0-SNAPSHOT

    问题:在使用idea导入项目,pom文件导入报错: Cannot resolve org.openjfx:javafx.base:11.0.0-SNAPSHOT 解决办法: 这是因为无法识别jdk,只 ...

  2. maven导入orcal坐标 报错 :Cannot resolve com.oracle:ojdbc14:11.2.0.1.0

    报错:Cannot resolve com.oracle:ojdbc14:11.2.0.1.0 解决方案: 好的第一步下载oracle JDBC驱动包,搜了下全是让付费下载那个破文件 ojdbc14这 ...

  3. Flutter 打包问题 Could not resolve io.flutter:arm64_v8a_release

    问题日志 Running Gradle task 'assembleRelease'... FAILURE: Build failed with an exception. * What went w ...

  4. [错误记录] --- clickhouse报错Decimal value is too small

    java操作clickhouse数据库,执行insert的时候,报错: Exception in thread "main" ru.yandex.clickhouse.except ...

  5. 【错误记录】Flutter 报错 Downloading the Dart SDK using the BITS service failed, retrying with WebRequest...

    文章目录 一. 报错信息 二.解决方案 ( 检查镜像地址环境变量设置 ) 1.检查镜像地址环境变量设置 ( 错误方案 没有解决问题 ) 2.尝试使用官方地址 三.总结 1.官方镜像 ( 推荐方案 ) ...

  6. flutter 报错java.net.URISyntaxException: Illegal character in opaque part at index 2

    记录flutter报错如下错误以及解决办法 FAILURE: Build failed with an exception. * What went wrong: Execution failed f ...

  7. php fpm 日志记录,如何解决nginx下php-fpm不记录php报错日志的问题

    如何解决nginx下php-fpm不记录php报错日志的问题 发布时间:2020-07-28 10:17:29 来源:亿速云 阅读:150 作者:Leah 本篇文章为大家展示了如何解决nginx下ph ...

  8. nginx php fpm 日志,nginx下php-fpm不记录php报错日志怎么办?

    解决nginx下php-fpm不记录php报错日志的办法:1.修改[php-fpm.conf]中配置,没有则增加:2.修改[php.ini]中配置,没有则增加:3.重启[php-fpm]即可. 解决n ...

  9. 【解决方法汇总】SpringBoot项目报错 Could not resolve placeholder ‘‘ in value “${}“

    SpringBoot项目启动报错 Could not resolve placeholder 'show.tips.text' in value "${show.tips.text}&quo ...

最新文章

  1. 禁止USB存储设备。
  2. excel分段排序_EXCEL基础篇第六章(日期和时间的使用方法)
  3. linux下memcache安装
  4. python字典遍历 没有顺序_Python中字典的顺序问题(为什么实践发现字典的遍历和方法popitem并不是随机的?)...
  5. CUDA学习笔记(三)
  6. Spring源码总结与分析
  7. Linux中buff-cache占用过高解决方案
  8. LOJ2392 JOISC2017 烟花棒 二分、贪心
  9. 百年铁树要开花,贾跃亭要还钱了?
  10. Web 攻防之业务安全:越权访问漏洞 测试.
  11. 计算字符串长度的五种方法
  12. PyQt5-小案例(复数计算器)
  13. pod定义和pod的配置
  14. chatgpt赋能Python-python2张图片合成1张图片
  15. 迅为4412开发板一键烧写QT程序到开发板
  16. java寻找图片,F12查找图片位置
  17. 宝塔面板定时执行python脚本
  18. 3d全景图片制作软件有哪些?哪款软件比较好用?
  19. 一篇文章畅游在C语言基础知识学习的海洋中(持续更新中……)
  20. smalldatetime mysql_「smalldatetime」datetime与smalldatetime之间的区别小结 - seo实验室

热门文章

  1. 推荐些在线小制作小工具
  2. js form中的onsubmit和action
  3. Winpcap 中sockaddr_storage问题收藏
  4. Python 爬虫从入门到进阶之路(七)
  5. 在django中使用django_debug_toolbar
  6. ViewPager (下)-- 利用 Fragment 实现美丽的 页面切换
  7. 关于服务器返回信息的Unicode转码的方法
  8. asp.net中使用CKEditor
  9. 线段树、二叉堆以及离散化入门
  10. 8.使用for循环和while循环遍历文件