Could not resolve all files for configuration: ':app:debugRuntimeClasspath'

Viewed 30437

I am attempting to implement a third party SDK bundle when I ran react-native run-android I got the following error:

Execution failed for task ':app:checkDebugAarMetadata'.

Could not resolve all files for configuration ':app:debugRuntimeClasspath'.

Could not resolve com.ts.auth-control-sdk:5.1.1. Required by: project :app

  > Could not resolve com.ts:auth-control-sdk:5.1.1.
    > Could not get resource 'https://www.jitpack.io/com/ts/auth-control-sdk/5.1.1/auth-control-sdk-5.1.1.pom'.
      > Could not GET 'https://www.jitpack.io/com/ts/auth-control-sdk/5.1.1/auth-control-sdk-5.1.1.pom'.
        > sun.security.validator.Validator.Exception: PKIX path building failed:

sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Inside of my app/build.gradle file, I have the following setup:

dependencies {
  ...
  implementation "com.ts:auth-control-sdk:5.1.1:arr"
  ...
}

Inside my android/build.gradle file I have the following:

allprojects {
  repositories {
    ...
    maven {
      url("$rootDir/../com/ts/auth-control-sdk/5.1.1")
    }

    google()
    jcenter()
    maven { url 'https://jitpack.io' }
  }
}

I am not even sure whether this third-party SDK even exists inside of Jitpack repository.

Did I err in the way I implemented the dependency?

As far as the maven directory, per the documentation I placed a folder called com/ inside the root folder of the mobile app and the folder structure of it is: com > ts > auth-control-sdk > 5.1.1

It seems as though if it's inside of maven {} it will go to Jitpack repo and look for library as opposed to just going to the root folder of the project. Am I correct in this conclusion?

By the way I placed it inside of maven {} because their documentation says to do so.

Could it be that $rootDir is what indicates to maven to go look at Jitpack since below all the libraries there is that:

maven { url 'https://www.jitpack.io' }

Am I correct in concluding that $rootDir is referencing that jitpack url and not the root directory of the application?

Well, I gave it a shot and came away with the same exact error.

I believe I am correctly notating the file in accordance with this documentation: https://docs.gradle.org/current/javadoc/org/gradle/api/artifacts/dsl/DependencyHandler.html

I am not notating it like so: implementation ("com.ts:auth-control-sdk-5.1.1@arr") { transitive=true }

and removed the following : maven { url 'https://www.jitpack.io' }

But then I get this error:

Execution failed for task ':app:checkDebugAarMetadata'.

Could not resolve all the files for configuration 'app:debugRuntimeClasspath'.

Could not find com.ts:auth-control-sdk-5.1.1:. Required by project :app

3 Answers

What worked for me was inside of android/build.gradle:

maven {
  url("$rootDir/..")
}

I also removed:

maven {
  url { www.jitpack.io/ }
}

So that it would not keep going to the Jitpack repo to look for that local directory.

Then inside of app/build.gradle:

dependencies {
   ...
   implementation('com.ts:auth-control-sdk:5.1.1@aar') { transitive=true }
}
**go to your setting.gradle and write the below line of code for the the control 
       of 
  libraries or dependencies **
     
     maven { url 'https://jitpack.io' }




      dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
    google()
    mavenCentral()
    jcenter() // Warning: this repository is going to shut down soon

    maven { url 'https://jitpack.io' }
}

} rootProject.name = "Xyz" include ':app'

If you have facing Gradle dependencies iss> Task :app:mergeDebugNativeLibs FAILED

Error Image

FAILURE: Build completed with 6 failures.

Execution failed for task ':app:checkDebugDuplicateClasses'. Execution failed for task ':app:desugarDebugFileDependencies'. Execution failed for task ':app:checkDebugAarMetadata'. Execution failed for task ':app:mergeDebugAssets'. Execution failed for task ':app:mergeDebugAssets'. Execution failed for task ':app:mergeDebugNativeLibs'.ue

in android studio?

Answer: If you using ANDROID 11 in your project then try the below options Go to settings Click option to Gradle, Execution, deployment Then click build Tools Solution Image choose to gradle

Then disable the offline mode then Run

Related