This question already has answers here:
Android Studio 3.1.3 Gradle Sync Error. Could Not Download Gradle-Core.jar
(4 answers)
Closed 4 years ago.
I run react-native 0.57.1 app, then I got the following lines.
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':app:debugCompileClasspath'.
/> Could not find support-vector-drawable.aar (com.android.support:support-vector-drawable:27.1.1).
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/support-vector-drawable/27.1.1/support-vector-drawable-27.1.1.aar
/> Could not find livedata-core.aar (android.arch.lifecycle:livedata-core:1.1.0).
Searched in the following locations:
https://jcenter.bintray.com/android/arch/lifecycle/livedata-core/1.1.0/livedata-core-1.1.0.aar
/> Could not find viewmodel.aar (android.arch.lifecycle:viewmodel:1.1.0).
Searched in the following locations:
https://jcenter.bintray.com/android/arch/lifecycle/viewmodel/1.1.0/viewmodel-1.1.0.aar
/> Could not find runtime.aar (android.arch.core:runtime:1.1.0).
Searched in the following locations:
https://jcenter.bintray.com/android/arch/core/runtime/1.1.0/runtime-1.1.0.aar
Below worked for me,
Try to put google() as the first repo as below.
Don't put it under jcenter() and mavenCentral() for your existing Android Studio projects.
And Just move google() from bottom to top in allprojects > repositories in build.gradle of module.
Originally, here is the answer
Open your android application using the android studio. Then try to build it. It will give u a direct information which causes to fail. It will suggest you to fixes as well. Then try to run it through that.
Most probably version complicit is there. All com.android.support libraries must use the exact same version. Check versions in your android Gradle files. This All com.android.support libraries must use the exact same version specification will help u to get an idea about it.
I posted it on my Github, then I've just got the answer: https://github.com/facebook/react-native/issues/21916. Simply on android/build.gradle I move google() to the first element in the list. Thx everyone!
Related
I cannot start my Android App if it includes the following line in the dependencies of the module level build.gradle file:
dependencies{
...
implementation 'io.nano:android-tex:1.0.0'
...
}
The gradle sync works without errors.
But when I try to start the app, I get the error that io.nano:android-tex:1.0.0 cannot be found. Here is a part of the error log:
3: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find io.nano:android-tex:1.0.0.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/io/nano/android-tex/1.0.0/android-tex-1.0.0.pom
- https://repo.maven.apache.org/maven2/io/nano/android-tex/1.0.0/android-tex-1.0.0.pom
Required by:
project :app
It seems to me that the URLs are simply wrong. https://repo.maven.apache.org/maven2/io/nano/android-tex/1.0.0/android-tex-1.0.0.pom does not lead to anywhere useful.
But the library exists on maven (see here: https://mvnrepository.com/artifact/io.nano/android-tex/1.0.0).
Is my gradle not smart enough to search at the right place?
A couple of months ago, I successfully used 'io.nano:android-tex:1.0.0' in a project. But after updating Android Studio to Bumblebee and updating gradle from 7.0.2 to 7.2, it does not work anymore. (I don't know if those upgrades are the reason, though, because it has been months since I had worked on the project the last time).
Can anyone help with this? I just want to find a way to use 'io.nano:android-tex:1.0.0' again in an Android App.
--- EDIT ---
I have also added jcenter to my repositories in my project level gradle file (to check if that makes a difference):
repositories {
google()
mavenCentral()
jcenter()
}
Unfortunately, that does not help.
from github site:
Library is available in jcenter repository, add this script to your build.gradle file to install:
you should add jcenter() to your libs repository, but remember that jcenter is kind-of deprecated. ask lib author for moving to more reliable repository
This question already has answers here:
Gradle build fails saying : Could not find org.jetbrains.kotlinx:kotlinx-collections-immutable-jvm:0.3.3
(5 answers)
Closed 1 year ago.
I want to learn android compose. but, I have a problem when I want to run my project, I am getting this error.
Please, help me. I can't figured out it.
many other people in forums suggest me to use jcenter() but, for me still wouldn't work. am i doing wrong ? gradle with jcenter()
This is my gradle configuration.
Gradle Configuration
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find org.jetbrains.kotlinx:kotlinx-collections-immutable-jvm:0.3.3.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/org/jetbrains/kotlinx/kotlinx-collections-immutable-jvm/0.3.3/kotlinx-collections-immutable-jvm-0.3.3.pom
- https://repo.maven.apache.org/maven2/org/jetbrains/kotlinx/kotlinx-collections-immutable-jvm/0.3.3/kotlinx-collections-immutable-jvm-0.3.3.pom
Required by:
project :app > androidx.compose.ui:ui:1.0.0-beta01 > androidx.compose.runtime:runtime:1.0.0-beta01
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
enter image description here
org.jetbrains.kotlinx:kotlinx-collections-immutable is still available on jcenter. Here's an issue regarding this: https://github.com/Kotlin/kotlinx.collections.immutable/issues/96
Add jcenter() to your repositories block:
repositories {
...
jcenter()
}
Not able to build the code getting error.
CONFIGURE FAILED in 5s
Could not find com.google.firebase:firebase-plugins:1.1.5.
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-plugins/1.1.5/firebase-plugins-1.1.5.pom
https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-plugins/1.1.5/firebase-plugins-1.1.5.jar
https://jcenter.bintray.com/com/google/firebase/firebase-plugins/1.1.5/firebase-plugins-1.1.5.pom
https://jcenter.bintray.com/com/google/firebase/firebase-plugins/1.1.5/firebase-plugins-1.1.5.jar
https://dl.bintray.com/android/android-tools/com/google/firebase/firebase-plugins/1.1.5/firebase-plugins-1.1.5.pom
https://dl.bintray.com/android/android-tools/com/google/firebase/firebase-plugins/1.1.5/firebase-plugins-1.1.5.jar
Required by:
project :
After lot of googling did not find any working solution.
top level gradle file
apply plugin: 'com.google.gms.google-services'
already added.
google(),jcentre repository added in build.gradle file.
I had the same issue this morning and I resolved adding the following to the repositories block of my project:
jcenter {url 'https://firebase.bintray.com/gradle'}
It seems another case where the artifact gone missing. I found there is another artifact called com.google.firebase:perf-plugin:1.1.5 and use it instead of com.google.firebase:firebase-plugins:1.1.5 to make my build works again. But somehow this is not documented anywhere so i am not sure whether this is intended name changes or not.
I tried running react-native run-android after having set up React Native using react-native init as I hate expo.
But, I am getting problem here as this:
Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Could not find support-vector-drawable.aar (com.android.support:support-vector-drawable:27.1.1).
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/support-vector-drawable/27.1.1/support-vector-drawable-27.1.1.aar
> Could not find livedata-core.aar (android.arch.lifecycle:livedata-core:1.1.0).
Searched in the following locations:
https://jcenter.bintray.com/android/arch/lifecycle/livedata-core/1.1.0/livedata-core-1.1.0.aar
> Could not find viewmodel.aar (android.arch.lifecycle:viewmodel:1.1.0).
Searched in the following locations:
https://jcenter.bintray.com/android/arch/lifecycle/viewmodel/1.1.0/viewmodel-1.1.0.aar
> Could not find runtime.aar (android.arch.core:runtime:1.1.0).
Searched in the following locations:
https://jcenter.bintray.com/android/arch/core/runtime/1.1.0/runtime-1.1.0.aar
Any idea on how to get this working? I tried every question possible, but none of them seems working!
This worked!
Just move google() from bottom to top in allprojects > repositories in build.gradle of module.
Reference -> https://stackoverflow.com/a/52950717/8237551
In my case I had to do the following
cordova plugin add cordova-android-support-gradle-release --fetch
Remove cordova-plugin-add-swift-support from my plugins
used the versions mentioned here https://cordova.apache.org/news/2017/11/10/plugins-release.html
to remove cordova-plugin-compat
and finally move to the top
maven {
url "https://maven.google.com"
}
or
google()
In my case I was set gradle folder expect %user_profile%\.gradle in android studio project setting and also I forgot to set GRADLE_USER_HOME to custom gradle folder.
Or you should set GRADLE_USER_HOME in Environment to custom folder or use default gradle folder that dose not need to GRADLE_USER_HOME
Insure U have a proper internet connection and bandwidth. (+Probabley Proxy setting).
I'm trying to upgrade our app from API 25 to API 28. New gradle plugin performs redirections from old com.android.support:support-v4:* to androidx.legacy:legacy-support-v4:1.0.0-alpha , but ./gradlew build fails to find .aar package for it:
* What went wrong:
Could not resolve all files for configuration ':rubens:noflavorDebugCompileClasspath'.
> Could not find support-v4.aar (androidx.legacy:legacy-support-v4:1.0.0-alpha1).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/androidx/legacy/legacy-support-v4/1.0.0-alpha1/support-v4-1.0.0-alpha1.aar
This name is listed in https://dl.google.com/dl/android/maven2/index.html , but I cannot access that package.
How can I solve that?
The question is pretty old but I'm posting the solution I found... it might help someone in the future.
I added the following in build.gradle:
maven { url 'https://maven.google.com' }