项目在android 模拟器上运行时,报错

来源:6-7 如何创建和使用Flutter的路由与导航?【边学边做】

低调的小火柴

2019-04-26

图片描述
Launching lib/main.dart on Android SDK built for x86 in debug mode…
Initializing gradle…
Resolving dependencies…

  • Error running Gradle:
    ProcessException: Process “/Users/smatch/repo/dart/flutter_trip/android/gradlew” exited abnormally:
    Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring root project ‘android’.

Could not resolve all artifacts for configuration ‘:classpath’.
Could not download fastutil.jar (it.unimi.dsi:fastutil:7.2.0)
Could not get resource ‘https://jcenter.bintray.com/it/unimi/dsi/fastutil/7.2.0/fastutil-7.2.0.jar’.
Could not GET ‘https://jcenter.bintray.com/it/unimi/dsi/fastutil/7.2.0/fastutil-7.2.0.jar’.
Connect to 127.0.0.1:1087 [/127.0.0.1] failed: Connection refused (Connection refused)

  • 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.org

BUILD FAILED in 11s
Command: /Users/smatch/repo/dart/flutter_trip/android/gradlew app:properties

Finished with error: Please review your Gradle project setup in the android/ folder.

编译ios 没有问题,编译android 会提示这个错误,在网上找了半天,配置gradle 版本,还是不行,请教老师

写回答

2回答

CrazyCodeBoy

2019-04-27

从log上看你是不是设置本地代理呢?程序从你的本地代理127.0.0.1:1087上下载依赖库失败

将代理关闭,多试几次吧

0
0

啥破狼

2019-04-27

试试科学上网?我以前也碰到过这个问题。

0
1
abcd而非abc
回复
低调的小火柴
我设置了镜像,下载url_launch 的时候能正常下载,就是运行flutter项目的时候报错,跟你的一样请问怎么解决的额?着急进行项目
2019-05-26
共1条回复

Flutter从入门到进阶 实战携程网App 一网打尽核心技术

解锁Flutter开发新姿势,,系统掌握Flutter开发核心技术。

4788 学习 · 3270 问题

查看课程