Flutter无法解析com.google.android.gms:play服务位置:16.+



我有一个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!

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

最新更新