【问题标题】:Failed to resolve tapandpay dependency in local无法在本地解决 tapandpay 依赖项
【发布时间】:2021-08-30 10:30:08
【问题描述】:

无法解决:com.google.android.gms:play-services-tapandpay:17.1.2 developer.google 的说明:

dependencies {
  // ...
  implementation 'com.google.android.gms:play-services-tapandpay:17.1.0'
  // Getting a "Could not find" error? Make sure you have added the unzipped SDK
  // location to your root build.gradle file as a local maven dependency
}
allprojects {
    // ...
    repositories {
        // ...
        google() // Google's public Maven repository
        maven { url "file:/path/to/your/repo/m2repository/" }  // Local path to the folder into which you unzipped the SDK
    }
}

ERROR:
Execution failed for task
> Could not resolve all files for configuration 
   > Could not find com.google.android.gms:play-services-tapandpay:17.1.2.
     Required by:
         project :app

我找不到正确的方法

【问题讨论】:

  • 也发布错误以便更好地理解
  • 您可以发布指向“developers.google”网站的链接并附上上述说明吗? official Google's maven repo中没有这样的工件(play-services-tapandpay)...
  • play-services-tapandpay - 这个库有私有访问权限。

标签: android gradle build.gradle android-tap-and-pay


【解决方案1】:

我解决了我的错误。 我添加到 build.gradle

allprojects {
    repositories {
        google()
        jcenter()
        mavenLocal()
       maven { url "file:/*pathto*/sdk/extras/google/m2repository/" }
    }
}

【讨论】:

    【解决方案2】:

    您可以通过以下方式解决此错误:

    1. 解压 lib 文件夹
    2. 将文件夹移至此路径(您的 android sdk 路径 Android/sdk/extras/google/m2repository)
    3. 将之前的路径添加到 build.gradle 文件中
    allprojects {
        repositories {
            google()
            jcenter()
             maven { url "file:*your path here*/Android/sdk/extras/google/m2repository"}
    
    1. 确保 lib 版本与我们添加的依赖项版本匹配。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-11-12
      • 2012-01-12
      • 1970-01-01
      • 1970-01-01
      • 2018-05-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多