I am looking for help on the resolving issue with Android Gradle.
in the /app/build.gradle :
dependencies {
compile 'com.leaking.slideswitch:app:1.0.0'
}
allprojects {
repositories {
mavenLocal()
maven{
url 'http://xlab-tech.com:45682/nexus/content/groups/public/'
}
mavenCentral()
jcenter()
}
}
But messages Gradle Sync:
Error:(34, 13) Failed to resolve: com.leaking.slideswitch:app:1.0.0
com.leaking.slideswitch is not published in maven anymore, to be confirmed you can search there. What I can suggest is just create a new class called SlideSwitch.java and copy all codes from here. Then You can do your task as usual. Hope this may help.
Related
When running my app Android Studio is running into a build error. The Error is:
Could not GET 'http://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jre8/1.2.0/kotlin-stdlib-jre8-1.2.0.jar'. Received status code 403 from server: Forbidden
I am unsure what the cause of this is and I haven't found a solution researching on Google. It looks like it's a related to a Kotlin jar but my project uses Java only.
My other apps build fine the issue above is occurring for just one project.
If anyone has any insights as to why this is happening I'd greatly appreciate it.
Thanks
its probably too late but just replace jcenter() in root build.gradle with:
maven {
url 'https://jcenter.bintray.com'
name 'jcenter'
}
in the project level build.gradle file add mavenCentral() to the both repositories
buildscript {
ext {
...
}
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
...
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}
Gradle is not syncing properly, getting this error.
Help me to resolve this error when i add this library and press sync now it show this error (Failed to resolve).
Help me please to resolve it?
You must add build.gradle
repositories { maven { url "http://dl.bintray.com/glomadrian/maven" } }
reference: https://android-arsenal.com/details/1/1985 and https://github.com/kmenager/material-animated-switch
You need to add this code on gradlle(Project) all projects
maven {
url "http://dl.bintray.com/glomadrian/maven"
}
In the end, it will look something like this
allprojects {
repositories {
google()
jcenter()
maven {
url "http://dl.bintray.com/glomadrian/maven"
}
}
}
After migrating from Android Studio 3.0 (Canary 5) to Android Studio 3.0 (Beta 1), and moving to latest gradle , i.e. 'com.android.tools.build:gradle:3.0.0-beta1'
When I try to gradle sync, it error stating below.
Failed to resolve: com.android.support:multidex:1.0.2
Failed to resolve: com.android.support:multidex-instrumentation:1.0.2
I check on Android Studio 3.0 Canary 9 - Failed to resolve packages, it doesn't solve my problem, as I already have this
maven {
url 'https://maven.google.com'
}
I'm surprise it is even asking for multidex 1.0.2, as I only have in my build.gradle
compile 'com.android.support:multidex:1.0.1'
I check using ./gradlew app:dependencies | grep multidex, it shows the failures as below (across various flavors etc)
+--- com.android.support:multidex-instrumentation:1.0.2 FAILED
+--- com.android.support:multidex:1.0.1
+--- com.android.support:multidex:1.0.2 FAILED
+--- com.android.support:multidex:1.0.1 -> 1.0.2 FAILED
Where did the dependencies of multidex:1.0.2 and multidex-instrumentation:1.0.2 comes from? How could I solve this problem?
Apparently my issue is I should post this:
maven {
url 'https://maven.google.com'
}
in allprojects and not in buildscript (the subtle different has blinded me where the issue is), which then looks like this:
allprojects {
repositories {
maven {
url 'https://maven.google.com'
}
}
}
Thanks to M D for the pointers!
For me, the solution is move the google() item up to make sure it's before the jcenter(). And actually, I will put the google() in the first place of all the repositories.
Need to add the following as well:
compile 'com.android.support:multidex:1.0.3'
After adding the above line, it worked for me in addition to the above answer
First you need to clean the project , and then rebuild it.
Build ----> Clean Project
Build ----> Rebuild Project
allprojects {
repositories {
google()
}
}
worked for me instead of
allprojects {
repositories {
maven {
url 'https://maven.google.com'
}
}
}
if you are in China,
Please use
allprojects {
respositories {
google()
}
}
to instead
allprojects {
respositories {
maven {
url 'https://maven.google.com'
}
}
}
don't ask me why, I don't want to tell you.... may be 'https://maven.google.com' was selected by GFW?
Adding google() in my allprojects solved my issue...
allprojects {
repositories {
jcenter()
google()
}
}
If none of the above solutions are working then add mavenLocal() :
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com'
}
mavenLocal()
google()
}
}
Move the google() item up to make sure it's before the jcenter().
repositories {
jcenter()
google()
}
Update all the gradle dependencies to latest version ..
That’s it
my problem was network connection. I needed to connect to a vpn server to connect to jcenter
In my cases, I have no need to requires multidex but I have added due to other dependencies requires[brightcove player]
So I have added below lines in gradle.properties and error was gone.
android.enableJetifier=true
anpVersion=6.18.3
I'm trying to build my android project using gradle and circleCI, but I've got this error :
* What went wrong:
A problem occurred configuring root project '<myproject>'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not find com.android.tools.build:gradle:2.2.3.
Searched in the following locations:
file:/home/ubuntu/.m2/repository/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.pom
file:/home/ubuntu/.m2/repository/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.jar
https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.pom
https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.jar
https://oss.sonatype.org/content/repositories/snapshots/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.pom
https://oss.sonatype.org/content/repositories/snapshots/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.jar
Required by:
:<myproject>:unspecified
Can someone explain me why I've got this problem please?
It seems the current versions of the Android Gradle plugin are not added to Maven Central, but they are present on jcenter. Add jcenter() to your list of repositories and Gradle should find version 2.2.3. On Maven Central the newest available version is 2.1.3: http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.android.tools.build%22%20AND%20a%3A%22gradle%22. You can also complain to the authors that the current versions are missing on Maven Central.
Reading sembozdemir answer in this post I have resolved a similar problem adding jcenter() in build.gradle (module: cordovaLib)
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
}
}
After the recent update to Android Studio 3.0 Canary 1, I got the following error:
> Could not resolve all dependencies for configuration ':classpath'.
> Could not find com.android.tools.build:gradle:3.0.0-alpha1.
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0-alpha1/gradle-3.0.0-alpha1.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0-alpha1/gradle-3.0.0-alpha1.jar
Required by:
project :
Here is what I had to add (to the project-level build.gradle):
buildscript {
repositories {
maven {
url 'https://maven.google.com'
}
....
}
Found here: https://developer.android.com/studio/preview/features/new-android-plugin-migration.html
i had the same issue when i update my android studio to 3.0 then its solved by adding
buildscript {
repositories {
...
// You need to add the following repository to download the
// new plugin.
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
}
}
from https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html#update_gradle
On my side I got the same issue because I used the wrong order of repositories.
google() should be added before jcenter()
buildscript {
repositories {
google()
jcenter()
}
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
}
}
Just change the mavenCentral() to jcenter()
Do you try it
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
// NOTE: Do not place your application dependencies here; they belong
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://jitpack.io"
}
flatDir {
dirs 'libs'
}
}
}
and
Build->Clear Project
Try this:
allprojects {
buildscript {
repositories {
maven {
url "https://dl.bintray.com/android/android-tools"
}
}
}
...
}
Updating CordovaLib -> build.gradle also worked for me, as above. I was looking at the root build.gradle initially which was correct and already included jcenter().
Only go to the following path and delete the caches folder completely then rebuild the project:
C:\Users\[Your User Name]\.gradle
Change the gradle version as same to android version like Right know we are using 2.3.2 of gradle
Add jcenter in your project gradle file and sync
The issue is caused by your type of internet connection which prevents or blocks Android Studio from downloading required files from jcenter, this should happen automatically when you build your solution. The solution to your problem is to connect to internet using your personal internet connection such as ADSL Router, rebuild the project and the download of necessary files will happen automatically.
I followed this guide to add an ArcGIS map to my app, but it doesn't work. I get the following error:
Error: Failed to resolve: com.esri.arcgis.android:arcgis-android:10.2.6-2
What am I doing wrong?
From your screenshots, you put your maven block in the wrong place. You put it under buildscript -> repositories, but according to https://developers.arcgis.com/android/guide/install-and-set-up.htm it should be under allprojects -> repositories:
allprojects {
repositories {
jcenter()
// add the esri arcgis maven repo
maven {
url 'http://dl.bintray.com/esri/arcgis'
}
}
}
The way you did it in your screenshot would cause the error you see.
As of 2021, the URL has been changed to https://esri.jfrog.io/artifactory/arcgis according to this announcement. So now you have to do it like this.
allprojects {
repositories {
google()
mavenCentral()
maven {
url 'https://esri.jfrog.io/artifactory/arcgis'
}
}
}