【问题标题】:Flutter Could not resolve com.google.android.gms:play-services-location:16.+Flutter 无法解析 com.google.android.gms:play-services-location:16.+
【发布时间】:2021-08-17 08:27:37
【问题描述】:

我有一个flutter项目,从昨天开始就出现这样的错误

Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
   > Could not resolve com.google.android.gms:play-services-location:16.+.
     Required by:
         project :app > project :location
      > Failed to list versions for com.google.android.gms:play-services-location.
         > Unable to load Maven meta-data from https://jcenter.bintray.com/com/google/android/gms/play-services-location/maven-metadata.xml.
            > Could not get resource 'https://jcenter.bintray.com/com/google/android/gms/play-services-location/maven-metadata.xml'.
               > Could not GET 'https://jcenter.bintray.com/com/google/android/gms/play-services-location/maven-metadata.xml'.
                  > Connect to jcenter.bintray.com:443 [jcenter.bintray.com/34.95.74.180] failed: Read timed out

不知道,新建项目的时候可以运行,但是添加位置库的时候,出现这样的错误。 这是我的 pubspec.yaml

dependencies:
  flutter:
    sdk: flutter
  shared_preferences: ^0.5.6+1
  http: ^0.12.0+4
  intl: ^0.16.1
  location: ^3.2.4

另外,这是我的颤振医生:

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 1.22.5, on Microsoft Windows [Version 10.0.19042.985], locale en-ID)

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[√] Android Studio (version 3.5)
[√] VS Code (version 1.56.2)
[√] Connected device (1 available)

• No issues found!

【问题讨论】:

    标签: flutter flutter-dependencies


    【解决方案1】:

    我使用另一个互联网连接修复了它。以前我使用家庭 WiFi 连接,然后我尝试使用移动热点。

    【讨论】:

    • 使用VPN也可以解决这个问题
    猜你喜欢
    • 2021-06-12
    • 2022-01-13
    • 2022-01-10
    • 2022-01-16
    • 1970-01-01
    • 2022-01-15
    • 1970-01-01
    • 1970-01-01
    • 2022-01-15
    相关资源
    最近更新 更多