颤振构建错误无法解析 com.google.android.gms:play-services-location:16.+

Posted

技术标签:

【中文标题】颤振构建错误无法解析 com.google.android.gms:play-services-location:16.+【英文标题】:FLUTTER BUILD ERROR Could not resolve com.google.android.gms:play-services-location:16.+ 【发布时间】:2022-01-10 21:15:42 【问题描述】:

我有一个带有位置库的颤振项目,但是出现了这样的错误:


* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > 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://dl.google.com/dl/android/maven2/com/google/android/gms/play-services-location/maven-metadata.xml.
            > Could not HEAD 'https://dl.google.com/dl/android/maven2/com/google/android/gms/play-services-location/maven-metadata.xml'.
               > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      > Failed to list versions for com.google.android.gms:play-services-location.
         > Unable to load Maven meta-data from https://dl.google.com/dl/android/maven2/com/google/android/gms/play-services-location/maven-metadata.xml.
            > Could not HEAD 'https://dl.google.com/dl/android/maven2/com/google/android/gms/play-services-location/maven-metadata.xml'.
               > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      > Failed to list versions for com.google.android.gms:play-services-location.
         > Unable to load Maven meta-data from https://dl.google.com/dl/android/maven2/com/google/android/gms/play-services-location/maven-metadata.xml.

还有这个库位置版本: location: any

这是我的 gradle.build :

    repositories 
        google()
        mavenCentral()
    

【问题讨论】:

嗨,您找到任何解决方案了吗 还没有,但我正在将库从服务位置更改为地理定位器。 我通过在本地下载位置包并更新版本代码解决了 能发个下载地址包的链接吗? 它在pub.dev右侧可用,---github.com/Lyokone/flutterlocation 【参考方案1】:

关闭 wifi,然后再次运行。我一周前遇到了同样的问题,还没有解决方案

【讨论】:

我不这么认为,这个库总是有问题。我将库更改为地理定位器并全部固定

以上是关于颤振构建错误无法解析 com.google.android.gms:play-services-location:16.+的主要内容,如果未能解决你的问题,请参考以下文章

在android平台类路径错误中运行任何颤振项目时出错

颤振错误:“小部件无法构建,因为已经在构建过程中”

颤振:无法构建android apk

无法解析 URL“https://pub.dartlang.org”。错误 (69):无法“发布升级”颤振工具。 5 秒后重试...(还剩 9 次尝试)

FAILURE:构建失败并出现异常。无法解析所有文件以进行配置

无法在 iOS 模拟器上运行颤振应用程序