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

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

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

Gradle is searching on Artifactory for a jar library file but it is an aar file

I'm new to Artifactory and Gradle, and I'm experiencing the following problem:
I have published on Artifactory an .aar file, which is the following file:
Lib-debug-1.0.0.aar
Now I want to resolve this dependency from a Gradle project, and I've written this code:
In settings.gradle, I've written this code:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
repositories {
google()
mavenCentral()
maven {
//name 'Lib-debug-1.0.0.aar'
url 'https://wbste.com/art/IN-DH-commands'
credentials {
username = "user"
password = "pwd"
}
}
jcenter() // Warning: this repository is going to shut down soon
}
}
In app/build.gradle file, I've written this code:
allprojects {
repositories {
maven {
//name 'Lib-debug-1.0.0.aar'
url 'https://wbste.com/art/IN-DH-commands'
credentials {
username = "user"
password = "pwd"
}
}
}
}
implementation("com.wfm.egrids:Lib-debug:1.0.0:aar")
When I build the project, the following errors are returned:
FAILURE: Build completed with 3 failures.
1 Task failed with an exception.
-----------
What went wrong:
Execution failed for task ':app:kaptGenerateStubsDevAretiDebugKotlin'.
> Error while evaluating property 'filteredArgumentsMap' of task
':app:kaptGenerateStubsDevAretiDebugKotlin'
> Could not resolve all files for configuration ':app:devAretiDebugCompileClasspath'.
> Failed to transform Lib-debug-1.0.0-aar.jar (com.wfm.egrids:Lib-debug:1.0.0) to match attributes {artifactType=android-classes-jar, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Could not find Lib-debug-1.0.0-aar.jar (com.wfm.egrids:Lib-debug:1.0.0).
Searched in the following locations:
https://wbste.com/art/IN-DH-commands/com/wfm/egrids/Lib-debug/1.0.0/Lib-debug-1.0.0-aar.jar
It seems like I'm searching for a .jar file, but my file isn't this:
https://wbste.com/art/IN-DH-commands/com/wfm/egrids/Lib-debug/1.0.0/Lib-debug-1.0.0-aar.jar
But this:
https://wbste.com/art/IN-DH-commands/com/wfm/egrids/Lib-debug/1.0.0/Lib-debug-1.0.0.aar
Where could I have set I want to search for a .jar file? How could I write I want to search for an .aar file?
If I write:
implementation(group: 'com.wfm.egrids', name: 'Lib-debug', version: '1.0.0', ext: 'aar')
I get the following error:
"Null extracted folder for artifact: ResolvedArtifact"
Any help will be truly appreciated! I'm stuck on this problem since two weeks
Maybe try to replace this line:
implementation("com.wfm.egrids:Lib-debug:1.0.0#aar")

Why removing jcenter() repository fails my Android Application build for sqlite-android:3.36.0

I've updated my Android Application gradle to use AGP 7.0
my gradle repositories resembles this
repositories {
google()
mavenCentral()
jcenter()
}
This shows that JCenter Maven repository is no longer receiving updates: newer library versions may be available elsewhere
When I remove jcenter() my build fails with this error
* What went wrong:
Execution failed for task ':app:mergeDevelopmentDebugNativeLibs'.
> Could not resolve all files for configuration ':app:developmentDebugRuntimeClasspath'.
> Could not find io.requery:sqlite-android:3.34.1.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/io/requery/sqlite-android/3.34.1/sqlite-android-3.34.1.pom
- https://repo.maven.apache.org/maven2/io/requery/sqlite-android/3.34.1/sqlite-android-3.34.1.pom
Required by:
project :app > project :background:worker > project :background:database
As my application employs api 'io.requery:sqlite-android:3.34.1'
The requery GitHub README.md file states I need to use the following gradle entry
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
However adding the above does not fix my gradle build error
Where am I going wrong?
I updated to sqlite-android:3.36.0 and stil get...
* What went wrong:
Execution failed for task ':app:mergeDevelopmentDebugNativeLibs'.
> Could not resolve all files for configuration ':app:developmentDebugRuntimeClasspath'.
> Could not find io.requery:sqlite-android:3.36.0.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/io/requery/sqlite-android/3.36.0/sqlite-android-3.36.0.pom
- https://repo.maven.apache.org/maven2/io/requery/sqlite-android/3.36.0/sqlite-android-3.36.0.pom
- https://jitpack.io/io/requery/sqlite-android/3.36.0/sqlite-android-3.36.0.pom
Required by:
project :app > project :background:worker > project :background:database
I have identified the issue
When I have this entry my build works:-
implementation 'com.github.requery:sqlite-android:3.36.0'
When I have this entry my build fails:-
api 'com.github.requery:sqlite-android:3.36.0'

Unable to get firebase-ui-auth from mavenCentral when I build an app with ./gradlew lintDebug

I'm trying to change a source of an android app's libraries from JCenter to MavenCentral, because the JCenter will be closed.
I've checked that firebase-ui-auth v7.1.1 and v7.2.0 are in MavenCentral, but when I build the app with ./gradlew lintDebug, the firebase-ui-auth is not found and the build is failed.
I've also checked that, if I use assembleDebug to build, or I run the app on AndroidStudio, the build succeeds and the app runs on a mobile devise.
I've also tried creating a new project on the AndroidStudio, and done following steps, but the build was still failed.
Add implementation "com.firebaseui:firebase-ui-auth:7.2.0" // or 7.1.1
Remove jcenter()
I put some logs below. Any idea why, and how to fix it?
Thanks!
./gradlew lintDebug:
* What went wrong:
Could not determine the dependencies of task ':app:lintDebug'.
> Could not resolve all artifacts for configuration ':app:debugAndroidTestCompileClasspath'.
> Could not find com.google.firebase:firebase-auth:.
Required by:
project :app > com.firebaseui:firebase-ui-auth:7.2.0
build.gradle:
buildscript {
...
repositories {
google()
mavenCentral()
...
}
...
}
allprojects {
repositories {
google()
mavenCentral()
...
}
}
...
build.gradle(:app):
...
dependencies {
...
implementation "com.firebaseui:firebase-ui-auth:7.2.0" // or 7.1.1
...
}
https://search.maven.org/artifact/com.firebaseui/firebase-ui-auth/7.2.0/aar

Gradle error when generating signed APK in Android Studio

I am new to Android Studio. My build compiles successfully until I try to generate a signed APK. Here is my current build.gradle file:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.1"
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I have looked at previous Stack Overflow answers and they all recommend putting the google() repository first, which I have done. I have also tried just adding "com.android.tools.lint:lint-gradle:27.1.1" to the dependencies section, but that has not worked.
Execution failed for task ':app:lintVitalRelease'.
> Could not resolve all files for configuration ':app:lintClassPath'.
> Could not resolve com.android.tools.lint:lint-gradle:27.1.1.
Required by:
project :app
> Could not resolve com.android.tools.lint:lint-gradle:27.1.1.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/lint/lint-gradle/27.1.1/lint-gradle-27.1.1.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/lint/lint-gradle/27.1.1/lint-gradle-27.1.1.pom'.
> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
> Could not resolve com.android.tools.lint:lint-gradle:27.1.1.
Any assistance is appreciated!
If you are not actively linting a project, it might be easier just to disable it.
android {
...
lintOptions {
checkReleaseBuilds false
}
}
That code should prevent that particular gradle task for running.

Failed to build an existing application due to lack of jcenter certificate - blocked by gradle

I tried to build an andruid application using latest andruid studio
Seems that gradle is blocked due to lack of jcenter certificate in local machine certstore. My colleguee succeed to build it on his machine so the problem is in the configuration and not the application code
Configuration : andruid studio 3.0.1, gradle 3.0.0 ?, windows 7
I also tried to workaround ssl handshake by replacing jcenter() in build.gradle with
maven {
url "http://jcenter.bintray.com"
}
but it didn't solve the problem
My build.gradle below:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Gradle console:
Executing tasks: [assemble]
Configuration on demand is an incubating feature.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'PDA'.
> Could not resolve all files for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:3.0.0.
Required by:
project :
> Could not resolve com.android.tools.build:gradle:3.0.0.
> Could not get resource 'http://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom'.
> Could not HEAD 'http://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom'.
> Connect to repo.jfrog.org:80 [repo.jfrog.org/52.72.224.151, repo.jfrog.org/34.204.33.255] failed: Connection timed out: connect
The plugin v.3.x.x
classpath 'com.android.tools.build:gradle:3.0.0'
is not in jcenter.
You have to use the google maven repo.
buildscript {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
If you are using Android Studio 3 and gradle v.4.x you can use the google() shortcut
buildscript {
repositories {
...
google()
}
}
Besides as #GabrieleMariotti alreay said, that library will not be found at JCenter, you should not get Connection timed out: connect but a message that the library was not found.
Connection timed out: connect hints, that you cannot access that URL from your machine. My best guess is that you have to use some Proxy to access this URL that properly configured for your colleague, but not for you.

Categories

Resources