Flutter踩坑之 Could not find io.flutter.....

用AS打开Flutter项目Android模块,然后build,结果报错如下:

Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Could not resolve io.flutter:flutter_embedding_debug:1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94.
  Required by:
      project :app
   > Could not resolve io.flutter:flutter_embedding_debug:1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94.
      > Could not parse POM http://download.flutter.io/io/flutter/flutter_embedding_debug/1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94/flutter_embedding_debug-1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94.pom
         > Already seen doctype.
   > Could not resolve io.flutter:flutter_embedding_debug:1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94.
      > Could not parse POM http://download.flutter.io/io/flutter/flutter_embedding_debug/1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94/flutter_embedding_debug-1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94.pom
         > Already seen doctype.
   > Could not resolve io.flutter:flutter_embedding_debug:1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94.
      > Could not parse POM http://download.flutter.io/io/flutter/flutter_embedding_debug/1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94/flutter_embedding_debug-1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94.pom
         > Already seen doctype.
> Could not resolve io.flutter:arm64_v8a_debug:1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94.
  Required by:
      project :app
   > Could not resolve io.flutter:arm64_v8a_debug:1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94.
      > Could not parse POM http://download.flutter.io/io/flutter/arm64_v8a_debug/1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94/arm64_v8a_debug-1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94.pom
         > Already seen doctype.
   > Could not resolve io.flutter:arm64_v8a_debug:1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94.
      > Could not parse POM http://download.flutter.io/io/flutter/arm64_v8a_debug/1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94/arm64_v8a_debug-1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94.pom
         > Already seen doctype.
   > Could not resolve io.flutter:arm64_v8a_debug:1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94.
      > Could not parse POM http://download.flutter.io/io/flutter/arm64_v8a_debug/1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94/arm64_v8a_debug-1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94.pom
         > Already seen doctype.
> Could not resolve io.flutter:x86_debug:1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94.
  Required by:
      project :app
   > Could not resolve io.flutter:x86_debug:1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94.
      > Could not parse POM http://download.flutter.io/io/flutter/x86_debug/1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94/x86_debug-1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94.pom
         > Already seen doctype.
   > Could not resolve io.flutter:x86_debug:1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94.
      > Could not parse POM http://download.flutter.io/io/flutter/x86_debug/1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94/x86_debug-1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94.pom
         > Already seen doctype.
   > Could not resolve io.flutter:x86_debug:1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94.
      > Could not parse POM http://download.flutter.io/io/flutter/x86_debug/1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94/x86_debug-1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94.pom
         > Already seen doctype.
> Could not resolve io.flutter:x86_64_debug:1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94.
  Required by:
      project :app
   > Could not resolve io.flutter:x86_64_debug:1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94.
      > Could not parse POM http://download.flutter.io/io/flutter/x86_64_debug/1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94/x86_64_debug-1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94.pom
         > Already seen doctype.
   > Could not resolve io.flutter:x86_64_debug:1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94.
      > Could not parse POM http://download.flutter.io/io/flutter/x86_64_debug/1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94/x86_64_debug-1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94.pom
         > Already seen doctype.
   > Could not resolve io.flutter:x86_64_debug:1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94.
      > Could not parse POM http://download.flutter.io/io/flutter/x86_64_debug/1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94/x86_64_debug-1.0.0-e7f9ef6aa0b9040102d1b3c9a6ae934df746ef94.pom
         > Already seen doctype.

解决办法:

Android项目的build.gradle 

allprojects {
    repositories {
        ......
       //添加这一行
        maven { url "https://storage.googleapis.com/download.flutter.io" }
    }
}

重新build,完成

参考地址:https://github.com/flutter/flutter/issues/39729

评论 11
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值