Failed to resolve tapandpay dependency in local

2k views Asked by At

Failed to resolve: com.google.android.gms:play-services-tapandpay:17.1.2 Instruction from 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

I can't find right way

2

There are 2 answers

0
Yevhenii Avram On BEST ANSWER

I resolved my bug. I added to build.gradle

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

You can resolve this error by following :

  1. Extract the lib folder
  2. Move the folder to this path (your android sdk path Android/sdk/extras/google/m2repository)
  3. Add the previous path to build.gradle file
allprojects {
    repositories {
        google()
        jcenter()
         maven { url "file:*your path here*/Android/sdk/extras/google/m2repository"}
  1. Make sure the the lib version is matching the dependency version that we've added.