1

无法解决:com.google.android.gms:play-services-tapandpay:17.1.2 来自developers.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

我找不到正确的方法

4

2 回答 2

1

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

allprojects {
    repositories {
        google()
        jcenter()
        mavenLocal()
       maven { url "file:/*pathto*/sdk/extras/google/m2repository/" }
    }
}
于 2021-08-31T10:17:52.900 回答
0

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

  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 版本与我们添加的依赖项版本匹配。
于 2021-10-21T10:06:10.517 回答