Android Studio:Could not resolve all artifacts for configuration ':classpath' - android

I created a new project in Android Studio and an error pops up:
A problem occurred configuring root project 'About Me'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0-release-764.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.5.0-release-764/kotlin-gradle-plugin-1.5.0-release-764.pom
- https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.5.0-release-764/kotlin-gradle-plugin-1.5.0-release-764.pom
Required by:
project :
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

try this :
ext.kotlin_version = "1.5.0"
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:4.2.0"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
it looks like there is some problems in server side just change kotlin version to 1.5.0 instead of 1.5.0-release-764

try this one :-
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:4.2.0"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
hope this will your answer visit this answer https://stackoverflow.com/a/75005827/12748481

I just closed the project and restarted it, error gone

Related

502 google.bintray.com Bad Gateway

I have started to build Gradle in my android project but I had the following problem, does anyone know what happens?
I'm trying to get the Tflite dependency from Maven, never had a problem until today.
Could not determine the dependencies of task ':app:processDebugResources'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
> Could not resolve org.tensorflow:tensorflow-lite:+.
Required by:
project :app > project :tflite
> Failed to list versions for org.tensorflow:tensorflow-lite.
> Unable to load Maven meta-data from https://google.bintray.com/exoplayer/org/tensorflow/tensorflow-lite/maven-metadata.xml.
> Could not get resource 'https://google.bintray.com/exoplayer/org/tensorflow/tensorflow-lite/maven-metadata.xml'.
> Could not GET 'https://google.bintray.com/exoplayer/org/tensorflow/tensorflow-lite/maven-metadata.xml'. Received status code 502 from server: Bad Gateway
We experienced the same the last two days. It looks like it is working again.
after 3 days working on a such problem
I solved it by editing the project buildgradle
[appname]/build.gradle
as below
repositories {
google()
//commit this: maven
//maven()
// add this
mavenCentral()
}
allprojects {
repositories {
google()
//commit this: maven
//maven()
// add this
mavenCentral()
}
}
Bonus:
i had the same problem with the same library so maybe you need this setting on the same build.gradle file
Kotlin version:
ext.kotlin_version = '1.5.0'
dependencies:
classpath 'com.android.tools.build:gradle:4.2.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
For those who still have issues with JCenter / Bintray, you can switch to JitPack.
All you need to do is to search the GitHub project of your choice in https://jitpack.io then copy-paste the provided code in your build.gradle file.
Comment jcenter() and add mavenCentral()
repositories {
jcenter()
mavenCentral()
google()
}

Gradle error : Could not find com.android.tools.build:gradle:2.2.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.

Ionic project won't build (or run) after android plugin updated to 2.2.0

Error message:
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'android'.
A problem occurred configuring project ':CordovaLib'.
Could not resolve all dependencies for configuration ':CordovaLib:classpath'.
Could not find com.android.tools.build:gradle:2.2.0.
Searched in the following locations:
https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.0/gradle-2.2.0.pom
https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.0/gradle-2.2.0.jar
Required by:
android:CordovaLib:unspecified
Remove platforms/android folder and add Android again:
ionic platform add android
buildscript {
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
}
}
add jcenter() to your repositories.
this worked for me.
A bit late but as the other answers didn't work hopefully this will help others
Update your Android CordovaLib to the latest version
https://cordova.apache.org/blog/
Find the latest version and run the command given
e.g. cordova platform update android#6.1.0
If this is not possible (or doesn't work) manually change the file
\platforms\android\CordovaLib\build.gradle and add in jcenter()
repositories {
mavenCentral()
jcenter()
}
buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
}
}
try modifying these in your build.gradle . good luck

Could not find gradle 2.2.0-rc1

After updating to Android Studio 2.2 RC, it asked me to update gradle plugin to 2.2.0-rc1. When I update I get the following error:
Error:Could not find com.android.tools.build:gradle:2.2.0-rc1.
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/gradle/2.2.0-rc1/gradle-2.2.0-rc1.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/2.2.0-rc1/gradle-2.2.0-rc1.jar
Required by:
:my_project:unspecified
Any clues on how I may fix it?
According to: https://code.google.com/p/android/issues/detail?id=221529
The problem is already fixed (exactly: hour ago). Just for sure rebuild your project.
Replace jcenter() instead of mavenCentral() in your project level build.gradle file
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
}
}

Android Studio cannot find com.android.tools.build:grade:2.10

Having resolved an error thanks to tihs 'Gradle Version 2.10 is required' post. I'm not getting a new error.
I've been trying to follow answers like this one but nothing I try seems to work. I wonder if this is because I'm on a later version of gradle and Android Studio. I'm still getting this error in Android Studio
Error:Could not find com.android.tools.build:gradle:2.10.
Searched in the following locations:
file:/Applications/Android Studio.app/Contents/gradle/m2repository/com/android/tools/build/gradle/2.10/gradle-2.10.pom
file:/Applications/Android Studio.app/Contents/gradle/m2repository/com/android/tools/build/gradle/2.10/gradle-2.10.jar
https://jcenter.bintray.com/com/android/tools/build/gradle/2.10/gradle-2.10.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/2.10/gradle-2.10.jar
Required by:
:android:unspecified
I've updated my build.gradle file to include:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.10'
}
}
And gradle-wrapper.properties to
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-2.10-all.zip
I'm at a loss of what to try next. This is app build on the Ionic framework (using cordova). the ionic build android command results in the same error too.
I'm using a Mac and Android Studio 2.1
Change
classpath 'com.android.tools.build:gradle:2.10'
to
classpath 'com.android.tools.build:gradle:2.1.0'
there is no version : 2.10 in gradle for Android Studio change it to:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
}
}
new answer :
please try to update gradle-wrapper.properties :
distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip
then in project build.gradle use this version:
classpath 'com.android.tools.build:gradle:1.5.0'
From menu: choose File -> Invalidate Caches/Restart... >> Invalidate and Restart
Gradle 2.x is not available in the maven repository, so you have to provide other repos to satisfy all your dependencies, in settings.gradle:
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
jcenter()
}

Categories

Resources