Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 385
Daniel Avatar asked Feb 27 '26 17:02

Daniel


2 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 }
}
like image 193
Daniel Avatar answered Mar 01 '26 06:03

Daniel


Go to your settings.gradle and write the following for 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'
like image 35
Mazhar Iqbal Avatar answered Mar 01 '26 07:03

Mazhar Iqbal



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!