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' }
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
I'm very new to GitHub, so maybe it's something obvious, but I followed all the steps of many many websites (also the SO questions of course), but it doesn't work.
I need to change up this GitHub project. (Which is actually a fork of this one)
Importing the GitHub project via Gradle and using it works like a charm. So because I need some little changes, I followed these steps:
I forked it
I changed the code how I needed it
I made a new release (3.1.1): this is my fork
Then:
I added maven { url "https://www.jitpack.io" } to my root gradle
I imported my fork in the app gradle: implementation 'com.github.tabkus:odomacrop:3.1.1'
I synchronized gradle
The importing of my fork seems to work fine because it doesn't show an error and it downloads a lot of data
But: I cannot use the code. I cannot import the classes. In this case I need for example the class UCrop as in the code
UCrop.of(...)
.withMaxResultSize(1080, 1080)
.start(activity);
But I cannot import it. I cannot import any class. I also tried Invalidate caches and restart in Android Studio but that didn't help either...
It simply says: Cannot resolve symbol 'UCrop'
EDIT:
I followed the answer and it solved an error. But it still didn't work. So I checked it on jitpack.io . The error now is Execution failed for task ':ucrop:signReleasePublication'. > Could not read PGP secret key. I looked it up on the internet but I couldn't find a fix for that. I assume some of the Gradle settings shall include some signing key and mine lack such a key. But since it is a fork, my Gradle files are exactly the same files. (I only made minor changes to some java.classes) jitpack.io/com/github/tabkus/odomacrop/2.2.7-2/build.log
Well...
Do not trust Android Studio sync, it sometimes does not popup errors for u
Using Gradle CLI directly to run a simple "assmeble" task like ./gradlew clean assembleDebug for an Android project.(Add -s to show more stacktrace if necessary)
In my case above command threw an error below:
> Task :app:mergeDebugResources FAILED
FAILURE: Build 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 com.github.tabkus:odomacrop:3.1.1.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/github/tabkus/odomacrop/3.1.1/odomacrop-3.1.1.pom
- https://repo.maven.apache.org/maven2/com/github/tabkus/odomacrop/3.1.1/odomacrop-3.1.1.pom
- https://www.jitpack.io/com/github/tabkus/odomacrop/3.1.1/odomacrop-3.1.1.pom
Required by:
project :app
Now the problem is obvious: your JitPack release got some problem absolutely. So I went to https://jitpack.io/#tabkus/odomacrop to check status:
Click the log icon, you will see the root cause:
Assuming you see as error message:
Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Could not find com.github.yalantis:ucrop:2.2.6.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/github/yalantis/ucrop/2.2.6/ucrop-2.2.6.pom
- https://repo.maven.apache.org/maven2/com/github/yalantis/ucrop/2.2.6/ucrop-2.2.6.pom
- https://jcenter.bintray.com/com/github/yalantis/ucrop/2.2.6/ucrop-2.2.6.pom
Required by:
project :app
Check first if this is similar to Yalantis/uCrop issue 779 -with Yalantis/uCrop being the original project)
you just move:
maven { url "https://jitpack.io" } from
build.gradle (Project) to
settings.gradle
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
jcenter()
maven { url "https://maven.google.com" }
maven { url "https://jitpack.io" }
}
}
rootProject.name = "<Project Name>"
include ':app'
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.
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!
After I updated my Android Studio to v2.3.3 and with it updated the required build tools and sdk version, have been getting the following error when I run ./gradlew assemble --stacktrace:
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring project ':OpenEdXMobile'.
Could not resolve all dependencies for configuration ':OpenEdXMobile:_prodDebugApkCopy'.
Could not find com.android.databinding:baseLibrary:2.3.3.
Searched in the following locations:
file:/usr/local/android-sdk/extras/android/m2repository/com/android/databinding/baseLibrary/2.3.3/baseLibrary-2.3.3.pom
file:/usr/local/android-sdk/extras/android/m2repository/com/android/databinding/baseLibrary/2.3.3/baseLibrary-2.3.3.jar
file:/home/travis/build/edx/edx-app-android/sdk-manager/com/android/databinding/baseLibrary/2.3.3/baseLibrary-2.3.3.jar
Required by:
project :OpenEdXMobile
Could not find com.android.databinding:baseLibrary:2.3.3.
Searched in the following locations:
file:/usr/local/android-sdk/extras/android/m2repository/com/android/databinding/baseLibrary/2.3.3/baseLibrary-2.3.3.pom
file:/usr/local/android-sdk/extras/android/m2repository/com/android/databinding/baseLibrary/2.3.3/baseLibrary-2.3.3.jar
file:/home/travis/build/edx/edx-app-android/sdk-manager/com/android/databinding/baseLibrary/2.3.3/baseLibrary-2.3.3.jar
Required by:
project :OpenEdXMobile > com.android.databinding:library:1.3.1
project :OpenEdXMobile > com.android.databinding:adapters:1.3.1
Full report from Travis-CI can be found here.
Here are some relevant details:
The gradle's distribution url: distributionUrl=https://services.gradle.org/distributions/gradle-3.3-all.zip
Gradle version in my module's build.gradle is v2.3.3.
My full build.gradle is kinda big so here's the link to it.
https://github.com/edx/edx-app-android/blob/f899aeca945dea9a010af727e2b3ff1176e86f4e/build.gradle
Do mention if I have missed any details :)
Sadly I wasn't able to find a solution that worked with the settings and versions mentioned in the question.
Quick Fix:
I just had to downgrade my gradle version to v2.3.0 and everything worked just fine.
Future plan:
Will update this answer once I find a solution, for now I've mentioned the quick fix, so that the community can benefit.