Failed to resolve: com.github.PhilJay.MPAndroidChart:v2.2.4 - android

When building, Gradle gave me the Failed to resolve: com.github.PhilJay:MPAndroidChart:v2.2.4 error.
I already added jitpack in build.gradle here:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
flatDir {
dirs 'aar'
}
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
This is based here. What am I missing?

Please check if you added below plugin in your build.gradle where you add dependancy of
compile 'com.github.PhilJay:MPAndroidChart:v2.2.4'
"apply plugin: 'maven'"

Switch to the latest version:
compile 'com.github.PhilJay:MPAndroidChart:v3.0.0-beta1'
And always use information for the main source - in this case MPAndroidChart Github Repo Readme.MD
If behind a proxy configure your proxy settings in gradle.properties as follows:
systemProp.http.proxyHost=103.7.11.34
systemProp.https.proxyPort=8080
systemProp.https.proxyHost=103.7.11.34
systemProp.http.proxyPort=8080
Note: IP address and port in the lines above to be replaced by your proxy server ip address (or url) and port

Did you add the following in your root build.gradle file: if not then add this.
repositories {
maven { url "https://jitpack.io" }
}
And Restart Android Studio and Rebuild your project.
I have faced same problem the problem was solved after restarting android studio --> rebuild project.
Also if not solved with above you may change the version of distributionUrl in gradle-wrapper.properties to the available newest.

Related

Could not find com.android.tools.build:gradle:4.1.1

When I run a project I get the error:
Could not find com.android.tools.build:gradle:4.1.1.
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.1.1/gradle-4.1.1.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/4.1.1/gradle-4.1.1.pom
Required by:
project :
Add google Maven repository and sync project
Open File
my gradle file looks like this:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.1"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
What can I do now?
The problem here is that the android tools plugin you want to use has moved. Old distributions are in jcenter, but new ones are at "https://maven.google.com"
Update your repositories to include "https://maven.google.com"
allprojects {
repositories {
google()
jcenter()
maven { url "https://maven.google.com" }
}
}
If you are in iran, china, etc... delete .gradle folder from android folder then try again with VPN.
Go to your gradle-wrapper.properties file in build.gradle and you will see the last line that specifies distributionUrl. Replace distributionUrl with below one.
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
Let the download finish and your problem will be resolved. If you want to avoid the download reduce the version of com.android.tools.build:gradle:4.1.1 this to 4.0.0+ or 3.0.0+
in iran, china, north korea , Afghanistan delete .gradle and gradle folder from android folder then try again with VPN and download gradle
classpath 'com.google.gms:google-services:3.0.0'
Please add above under dependencies

Could not resolve com.android.tools.build.gradle:3.0.1

I'm forcing gradle to use http
I have modified my gradle-wrapper.properties:
distributionUrl=http\://services.gradle.org/distributions/gradle-4.3-all.zip
The build.gradle:
buildscript {
repositories {
//jcenter()
//google()
maven { url "http://jcenter.bintray.com"}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}}
allprojects {
repositories {
jcenter()
maven { url 'http://maven.google.com' }
maven { url "http://jitpack.io" }
}}
As far as I'm aware I should use 3.0.1 but when I check the actual repo on jitpack or maven only up to 2.3.3 is available.
The error message I'm getting is:
> Could not resolve all files for configuration ':classpath'.
> Could not find com.android.tools.build:gradle:3.0.1.
Searched in the following locations:
http://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom
http://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.jar
Required by:
project :* Try:
Gradle version is 4.3.1 JVM 9.0.1
What can be done to successfully run 'gradle test' here?
EDIT:
uncommenting //google() reveled:
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom'.
When modified the http repo
buildscript {
repositories {
//jcenter()
//google()
maven { url "http://jcenter.bintray.com"}
maven { url "http://maven.google.com"}
}
I got:
> Could not resolve com.android.tools.build:gradle:3.0.1.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.0.1/gradle-3.0.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.build:gradle:3.0.1.
> Could not get resource 'http://maven.google.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom'.
> Could not GET 'http://maven.google.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom'.
> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
I get the same if I uncomment both jcenter() and google(). Besides, when I check https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/ the link is dead.
Now the jcenter repo https://repo1.maven.org/maven2/com/android/tools/build/gradle/ ends on 2.3.3 version which seems to be correct that this error is happening, the question is what is wrong then?
EDIT- Likely solution the issue happenned because you can't run those excluding https completely, it will fail either way.
Could not resolve com.android.tools.build:gradle:3.0.1.
Read Google's Maven repository
Include Google's Maven repository in your top-level build.gradle file:
FYI
allprojects {
repositories {
google()
// If you're using a version of Gradle lower than 4.1, you must instead use:
// maven {
// url 'https://maven.google.com'
// }
// An alternative URL is 'https://dl.google.com/dl/android/maven2/'
}
}
So, According to your version your build.gradle will
buildscript
{
repositories {
jcenter()
google()
maven { url "http://jcenter.bintray.com"}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
allprojects
{
repositories {
jcenter()
maven { url "https://jitpack.io" }
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I got the same issue and i solved it by making changes main gradle file, as per suggestion given by android studio
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
gradle-wrapper.properties :
distributionUrl= https\://services.gradle.org/distributions/gradle-4.1-all.zip
my gradle file is like this, make like this in you project it would most probably work.
Thank you.
What worked for me was to remove jcenter() and revert Gradle to an earlier version.
Unfortunately the latest stable version in bintray is 2.3.3 , but atleast I was able to build successfully.
My build.gradle now looks like this:
buildscript {
repositories {
maven { url "http://jcenter.bintray.com"}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven { url "http://jcenter.bintray.com"}
}
}
Try this and make sure your network works well (no proxy ...) :
in gradle-wrapper.properties :
distributionUrl= https\://services.gradle.org/distributions/gradle-4.1-all.zip
and in build.gradle:
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
allprojects {
repositories {
jcenter()
google()
}
}
Add following code into your app level gradle file.
buildscript {
repositories {
mavenCentral()
jcenter()
maven { url "http://jcenter.bintray.com"}
maven { url "http://maven.google.com"}
}
Not sure but your this error Could not resolve all files for configuration ':classpath'. When your path is not set so Follow below step:
Go to the File -> Setting -> Version Controller
Then you Change VCS to < None >
see below image :
I got the same issue because I used to set proxy(no proxy now) and click the OK button in
proxy setting,
so, check the following:
echo $proxy(mac)
/user/XXX/.gradle/gradle.properties
# systemProp.https.proxyPort=1080
# systemProp.http.proxyHost=127.0.0.1
# systemProp.https.proxyHost=127.0.0.1
# systemProp.http.proxyPort=1080
project/gradle.properties
I had the same problem, for solving it I did the following
1- install android studio with required SDKs
2- set manual proxy in android studio: File > Settings > Appearance & Behavior > System Settings > HTTP Proxy
3- In android studio click on Gradle icon, to sync project with gradle files.
Then
4- while android studio and proxy are active, in command prompt by running this command "ionic cordova build android" (I was using ionic platform), it will download all requirement gradle libraries and packages.
Check that you don't filter Google IPs.
This worked for me, I needed to install google dependencies
Another explanation is VPN. When my work's VPN is ON, on my Mac, I get this error. When off, I don't. Could be something particular to my VPN's configuration. So, if you have a VPN running, try disabling it turning the build.
I had problems with the snap version of gradle in my GNU/Linux distribution.
I fixed with:
sudo snap remove gradle
sudo apt install gradle

Could not resolve io.fabric.tools:gradle:1.+

I'm having an issue with building my project. First time build. I'm behind a proxy and all other dependencies downloaded only this having an issue.
I tried a few options found on SO, but had no luck so far. Can someone give me a clue on how to fix this?
Things I tried so far:
File -> Invalidate Cache/Restart -> Invalidate and Restart
updated the crashlytics:2.5.5#aar to crashlytics:2.6.4#aar
restarted Android Studio
I'm not in offline mode
app/build.gradle
buildscript {
repositories {
maven { url https://maven.fabric.io/public }
mavenCentral()
jcenter()
}
}
apply plugin: 'io.fabric'
dependencies {
compile("com.crashlytics.sdk.android:crashlytics:2.5.5#aar") {
transitive = true
}
}
Root build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
Error:
Failed to list versions for io.fabric.tools:gradle.
Unable to load Maven meta-data from https://maven.fabric.io/public/io/fabric/tools/gradle/maven-metadata.xml.
Could not GET 'https://maven.fabric.io/public/io/fabric/tools/gradle/maven-metadata.xml'.
Connect to maven.fabric.io:443 [maven.fabric.io/54.230.133.33] failed: Connection refused: connect
Could not resolve io.fabric.tools:gradle:1.+.
Failed to list versions for io.fabric.tools:gradle.
Unable to load Maven meta-data from https://jitpack.io/io/fabric/tools/gradle/maven-metadata.xml.
Could not GET 'https://jitpack.io/io/fabric/tools/gradle/maven-metadata.xml'.
Connect to jitpack.io:443 [jitpack.io/104.24.23.62, jitpack.io/104.24.22.62] failed: Connection refused: connect
Could not resolve io.fabric.tools:gradle:1.+.
Failed to list versions for io.fabric.tools:gradle.
Unable to load Maven meta-data from https://repo1.maven.org/maven2/io/fabric/tools/gradle/maven-metadata.xml.
Could not GET 'https://repo1.maven.org/maven2/io/fabric/tools/gradle/maven-metadata.xml'.
Connect to repo1.maven.org:443 [repo1.maven.org/151.101.24.209] failed: Connection refused: connect
Could not resolve io.fabric.tools:gradle:1.+.
Failed to list versions for io.fabric.tools:gradle.
Unable to load Maven meta-data from https://jcenter.bintray.com/io/fabric/tools/gradle/maven-metadata.xml.
Could not GET 'https://jcenter.bintray.com/io/fabric/tools/gradle/maven-metadata.xml'.
Connect to jcenter.bintray.com:443 [jcenter.bintray.com/75.126.118.188] failed: Connection refused: connect
Came across the same issue.
i resolve it by installing the latest fabric plugin for android studio.
Add the following to the build.gradle .
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:VVV'
}
}
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
WHERE VVV is the latest version. In my case VVV IS 1.31.2
Add this to the manifest
<meta-data
android:name="io.fabric.ApiKey"
android:value="xxxxxxxxxxxxxxxxxxxxxxx" />
where xxxxxxxxxxxxxxxx is your obtained value.
Add this to your launcher class.
Fabric.with(this, Crashlytics())
Rebuild project and you are good to go.
Well, the error seems pretty clear. You cannot connect to either of the repos via HTTPS. As it is unlikely that all those are down and you already said you are behind a proxy, configure the HTTPS proxy via Gradle properties as described in the users guide and you should be fine.
If you proxy is configured properly on Gradle side, maybe the proxy blocks the requests due to some condition. In that case you should probably ask the maintainer of that proxy.
Edit Project Gradle like this
buildscript {
repositories {
google()
jcenter()
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.google.gms:google-services:3.3.0'
classpath 'io.fabric.tools:gradle:1.25.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven {
url 'https://maven.google.com/'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I
tried adding maven repo url but did not work, problem is that Firebase Crashlytics have decided to change their dependency name from
io.fabric.tools:gradle
to
com.google.firebase:firebase-crashlytics-gradle
with the aquisition of Fabric by Firebase.
So instead of
classpath "io.fabric.tools:gradle:1.25.4"
use
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.1.0'
and also change the
apply plugin: 'io.fabric'
to
apply plugin: 'com.google.firebase.crashlytics'
References
https://firebase.google.com/docs/crashlytics/get-started?platform=android
This error:
Could not find any matches for io.fabric.tools:gradle:1.+ as no versions of io.fabric.tools:gradle are available.
happens when the option "Offline work", located in Settings->Build, Execution, Deployment->Gradle->Global Gradle settings is selected.
To solve the problem, you have to change:
From: io.fabric.tools:gradle:1.+
To: io.fabric.tools:gradle:1.0
When you do, Android Studio itself will warn you about the latest version. In my case it was: 1.25.4.
So, in my case, it was like this:
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
classpath 'io.fabric.tools:gradle:1.25.4'
}
I hope it helps someone else.
Faced the same issue, resolved with upgrading the fabric gradle to the latest version. Below is the code,
dependencies {
classpath 'io.fabric.tools:gradle:1.25.4'
}
I had the same problem, just make sure you follow these steps so crashlytics will be installed successfully:
1) add this in your project level gradle:
buildscript {
repositories {
google()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.google.gms:google-services:4.2.0'
classpath 'io.fabric.tools:gradle:1.27.1'
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
}
2) In your app level gradle
in the very beginning of the file add:
apply plugin: 'io.fabric'
apply plugin: 'com.google.gms.google-services'
and in the dependencies block add:
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.9'
After adding all of that, it has finally worked for me. Hope it helps. Cheers
Well, first add these to gradle.properties(Project Properties)
For http use:
systemProp.http.proxyHost=your_proxy_host
systemProp.http.proxyPort=your_proxy_port
systemProp.http.proxyUser=your_proxy_username
systemProp.http.proxyPassword=your_proxy_password
For https use:
systemProp.https.proxyHost=your_proxy_host
systemProp.https.proxyPort=your_proxy_port
systemProp.https.proxyUser=your_proxy_username
systemProp.https.proxyPassword=your_proxy_password
Then got to File -> Settings -> Appearance & Behavior -> System Settings -> HTTP Proxy, select Manual Proxy Configuration, select HTTP, enter Host name, enter Port number, select Proxy authentication, enter login(your proxy username), enter password(your proxy password), (note you can optionally Check connection)then Apply and OK. Done!!!
Use this link to find the latest fabric gradle plugin
Latest Fabric Gradle Plugin
Avoid using + in version numbers; can lead to unpredictable and unrepeatable builds (io.fabric.tools:gradle:1.+)
Using + in dependencies lets you automatically pick up the latest available version rather than a specific, named version. However, this is not recommended; your builds are not repeatable; you may have tested with a slightly different version than what the build server used. (Using a dynamic version as the major version number is more problematic than using it in the minor version position.)
*Add the following in your project/build.gradle**
buildscript {
repositories {
google()
jcenter()
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'io.fabric.tools:gradle:1.25.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
**Add the following in your app/build.gradle**
apply plugin: 'io.fabric'//on top
dependencies {
//Crashlytics
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.9'
}
I get this issue, i solved it by enabling gradle offline support,
if you don't want to repeat this issue again in future.
I will suggest you to enable gradle offline support, it will solve the issue.
You can easily disable/enable offline support at anytime you want in future.
Please check the following
Go to Preferences > Gradle and check/uncheck "Offline work".
It might be because the domain is blacklisted by https://github.com/notracking/hosts-blocklists which uses various of sources to collect a blacklist https://github.com/notracking/hosts-blocklists/blob/master/SOURCES.md
As a workaround you could overwrite the blacklisted entry (dnsmasq example)
# conf-file=/etc/dnsmasq/blocked_domains.txt
address=/fabric.io/50.19.118.60
address=/maven.fabric.io/99.86.238.75
The IP adresses might change. You'll have to check yourself.
or use the IP instead of the hostname in build.gradle

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.

Android Studio: Could not find com.android.tools.build:gradle:2.0.0-alpha2

Recently I have updated my Android Studio to latest version from Latest Android Studio Canary Build: 2.0 Preview
After updating to the new version, my current working directory stop working at all. Every single time when I am trying to clean and build a project they will give me an error like this
Blockquote
'Error:Could not find com.android.tools.build:gradle:2.0.0-alpha2.
Searched in the following locations:
file:/Applications/Android Studio.app/Contents/gradle/m2repository/com/android/tools/build/gradle/2.0.0-alpha2/gradle-2.0.0-alpha2.pom
file:/Applications/Android Studio.app/Contents/gradle/m2repository/com/android/tools/build/gradle/2.0.0-alpha2/gradle-2.0.0-alpha2.jar
https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.0.0-alpha2/gradle-2.0.0-alpha2.pom
https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.0.0-alpha2/gradle-2.0.0-alpha2.jar
Required by:
:android 3:unspecified'
Anyone have an idea how to solve this problem. Thanks in advance.
UPDATE: I am using a Mac machine and installation directory look like
Apparently the build tools have been moved from maven to jcenter so you need to change the code from:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-alpha2'
}
}
to this
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-alpha2'
}
}
More details on the changes:
Android Tools Project Site
http://tools.android.com/recent
Android Developer Tools community https://plus.google.com/communities/114791428968349268860/stream/7f20992b-7d9a-4309-9d94-6fbe08f0ad6e
In the main build.gradle file, add jcenter() as main repo, just like that :
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
Remove other repositories or make sure jcenter is the first one.
On my side travis build failed with error message "Could not find com.android.tools.build:gradle:3.0.1".
After addeing google() as additional repository the problem was gone.
buildscript {
repositories {
jcenter()
google()
My local build did not fail because i had installed before "com.android.tools.build:gradle:3.0.1" with anddroid-sdk-manager
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
repositories block should be in buildscript.
Check to see if gradle 2.0.0-alpha1 is available on your system. Look in your android/tools/build/gradle folder. In my case, despite the confusing message "This project is using a preview version of the Gradle plugin (2.0.0-alpha2) and a newer version is available (2.0.0-alpha2) You can update to 2.0.0-alpha2." the version in my folder was 2.0.0-alpha1, and changing my build.gradle to:
classpath 'com.android.tools.build:gradle:2.0.0-alpha1'
fixed my build problem.
I removed the newest folder gradle-4.1-all in C:\Users\YOUR_USER_NAME\ .gradle\wrapper\dists\ and then I created a new project in Android Studio and the following message disappeared:
"Gradle sync failed: Could not find com.android.tools.build: Gradle:
3.0.0-beta6. "
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven { url "https://maven.google.com" }
maven { url "https://jitpack.io" }
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I have tried something like
platfoms > android > cordova >lib > builders > Gradlebuilder.js
Downloaded zip and given path
var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'file\:///C:/MyPC/Documents/softwares/gradle-2.14.1-all.zip';
and linking path is
allprojects {
repositories {
mavenLocal()
google()
jcenter()
maven{url "http://jcenter.bintray.com"}
}
}
It worked for me.
this is for Ionic developers *
This seems to be a very long issue(years on the making)...most of the hints are about settings and gradle scripts. After a few days of digging around and backing from BumbleBee to 3.4.2 I kept on getting the same issue no matter what I tried. In the end the gradle on line URLs are blocked for my location due to network ... so easy for Google to say check the access is proper and not keep us blindfolded throwing darts in the dark

Categories

Resources