Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not resolve com.android.tools.build:gradle:2.3.+ #605

Closed
andrewkslv opened this issue Dec 12, 2017 · 37 comments
Closed

Could not resolve com.android.tools.build:gradle:2.3.+ #605

andrewkslv opened this issue Dec 12, 2017 · 37 comments

Comments

@andrewkslv
Copy link

andrewkslv commented Dec 12, 2017

I'm getting an error after running react-native run-android which is totally fine by building the project in android 3+ studio. Does anyone have an idea why it could happen?

ps. I could open the link manually in a browser.

Building and installing the app on the device (cd android && ./gradlew installDebug)...

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApk'.
   > A problem occurred configuring project ':react-native-vector-icons'.
      > Could not resolve all dependencies for configuration ':react-native-vector-icons:classpath'.
         > Could not resolve com.android.tools.build:gradle:2.3.+.
           Required by:
               rntest:react-native-vector-icons:unspecified
            > Could not resolve com.android.tools.build:gradle:2.3.+.
               > Failed to list versions for com.android.tools.build:gradle.
                  > Unable to load Maven meta-data from https://jcenter.bintray.com/com/android/tools/build/gradle/maven-metadata.xml.
                     > Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/maven-metadata.xml'.
                        > Connect to 127.0.0.1:8888 [/127.0.0.1] failed: Connection refused (Connection refused)

"react-native": "0.51.0"
"react-native-vector-icons": "^4.4.2"

OS: macOS Sierra

[email protected] Test repository https://github.com/EclipticWld/rntest

upd: I found out that I can't reach jcenter.bintray.com with terminal and I have no idea why because I don't use any firewalls.

ping jcenter.bintray.com
PING dl.bintray.com (159.122.18.156): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
Request timeout for icmp_seq 4
Request timeout for icmp_seq 5
Request timeout for icmp_seq 6
Request timeout for icmp_seq 7
^C
--- dl.bintray.com ping statistics ---
9 packets transmitted, 0 packets received, 100.0% packet loss
@oblador
Copy link
Owner

oblador commented Dec 19, 2017

Did you resolve it? Closing as it doesn't really seem related to this package, reopen if you think otherwise.

@oblador oblador closed this as completed Dec 19, 2017
@andrewkslv
Copy link
Author

andrewkslv commented Dec 19, 2017

Not completely. Right, it doesn't relate to this package. Thanks!

@song50119
Copy link

+1

@amitbravo
Copy link

Its internet. my wifi was disconnecting when I was run android build and got this error.

@vinaygosain
Copy link

I am facing the same issue, please reopen this

@rodrigofbm
Copy link

cd project/android/app 

and run

./gradlew clean

@brownieboy
Copy link

This error just started popping up for me for two different projects across two different Macs.

Internet seems fine. I’m not behind any proxies.

@brownieboy
Copy link

...and 30 minutes later the error disappeared. I'm pretty sure that I hadn't changed a thing in the meantime.

I'm guessing a server issue at the jcenter end or maybe just some networking issues with my ISP.

@luuvansinh
Copy link

same issue

@DaniloT
Copy link

DaniloT commented Dec 10, 2018

I just encountered this issue, in 2 different PCs, in 2 different projects in both. It was not going away by itself, but I fixed it doing 2 things, in my node_modules/react-native-vector-icons/android/build.gradle, added the google() repository and updated the gradle dependency, as such:

buildscript {
  repositories {
    google()
    jcenter()
  }

  dependencies {
    classpath 'com.android.tools.build:gradle:3.1.4'
  }
}

From what it seems, this will happen every now and then when jcenter decides to change things, in most cases you can just wait for it to fix itself but i'd recommend doing this for vector icons next release to avoid these sudden downtimes.

@AFMW
Copy link

AFMW commented Dec 10, 2018

I get this error after try what @DaniloT did:
A problem occurred evaluating project ':react-native-vector-icons'.
Could not find method google() for arguments [] on repository container.

@DaniloT
Copy link

DaniloT commented Dec 10, 2018

@AFMW there's a lot of reasons that could happen, I'd recommend first trying a ./gradlew clean in your apps android directory.

Mostly, to fix this, I think you'll need to update your own projects gradle, which is recommended anyway. But if it is not an option, then I guess you might need to wait for the jcenter repository to get back to working condition and the error to go away by itself. Check your apps gradle version against mine.

For reference, my apps build.gradle is:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        buildToolsVersion = "27.0.3"
        minSdkVersion = 16
        compileSdkVersion = 27
        targetSdkVersion = 26
        supportLibVersion = "27.1.1"
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.4'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        mavenLocal()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
        maven { url 'https://maven.google.com' }
        maven { url "https://jitpack.io" }
    }
}


task wrapper(type: Wrapper) {
    gradleVersion = '4.4'
    distributionUrl = distributionUrl.replace("bin", "all")
}

While the distribution url in my android/gradle/wrapper/gradle-wrapper.properties is:

distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

@DaniloT
Copy link

DaniloT commented Dec 10, 2018

I'm sorry, I didn't notice I was using the wrong version in my package.json file, had it as ^5.0.0, that is why this package was using such an old gradle version. Updating react-native-vector-icons in my package.json file to at least 6.0.2 already applies exactly what I was suggesting, so anyone running into this issue, do update your package instead of doing this manually.

Also be careful that 6.1.0 requires gradle 3.2 at least to work so do take care to update when needed.

@gidox
Copy link

gidox commented Dec 10, 2018

@DaniloT that works for me (Y)

@chmiguel
Copy link

i have the same problem since today :/

@kerwin-ly
Copy link

I encountered same issue, today.any solution?

@abartolo
Copy link

I am having this issue today but will try tomorrow as this seems like a jcenter issue as @DaniloT mentioned above. My package.json is fixed so I am not too worried as this seems like an third party issue.

@phanvinh876
Copy link

I getting this issue in today morning. Hopefully it will fix soon

@pavermakov
Copy link

Same issue for me. Unable to build on android starting this morning.

@jayrparro
Copy link

It worked for me.
Upgrade "react-native-vector-icons": "^6.0.2" in package.json

Then, do/follow the manual installation guide for android on this link.

@tandat2209
Copy link

It worked for me.
Upgrade "react-native-vector-icons": "^6.0.2" in package.json

Then, do/follow the manual installation guide for android on this link.

Thank a lot, bro!

@irodeanu
Copy link

Yes, the update is the solution but many icons are no longer valid, must be searched and modified.

divs1210 added a commit to simpledotorg/simple-experiments that referenced this issue Dec 11, 2018
@pinguo-zhouwei
Copy link

@jayrparro Upgrade "react-native-vector-icons": "^6.0.2" in package.json dont't work, install apk get wrong with info:
What went wrong:
Execution failed for task ':app:bundleStagingDebugJsAndAssets'.

Process 'command 'node'' finished with non-zero exit value 1

@alainib
Copy link

alainib commented Dec 11, 2018

i get this problem too. compiling yesterday, start the computer today morning without changing anything and not compiling...

@nikhilbhavsar07
Copy link

It worked for me.
Upgrade "react-native-vector-icons": "^6.0.2" in package.json

Then, do/follow the manual installation guide for android on this link.

@jayrparro getting this error after upgrading the package:
FAILURE: Build failed with an exception.

  • Where:
    Build file '/Users/Projects/MyApp/node_modules/react-native-vector-icons/android/build.gradle' line: 4
    line no. 4 is => google()

@alainib
Copy link

alainib commented Dec 11, 2018

It worked for me.
Upgrade "react-native-vector-icons": "^6.0.2" in package.json
Then, do/follow the manual installation guide for android on this link.

@jayrparro getting this error after upgrading the package:
FAILURE: Build failed with an exception.

* Where:
  Build file '/Users/Projects/MyApp/node_modules/react-native-vector-icons/android/build.gradle' line: 4
  line no. 4 is => google()

did you get this error too :

  • Where:
    Build file 'D:\workspace\iosReactTest2\node_modules\react-native-vector-icons\android\build.gradle' line: 4

  • What went wrong:
    A problem occurred evaluating project ':react-native-vector-icons'.

Could not find method google() for arguments [] on repository container.

@randomco
Copy link

It worked for me.
Upgrade "react-native-vector-icons": "^6.0.2" in package.json

Then, do/follow the manual installation guide for android on this link.

This worked for me. Did not do manual installation - even installing using npm and then using react-native to link automatically caused this error to go away.

@nikhilbhavsar07
Copy link

It worked for me.
Upgrade "react-native-vector-icons": "^6.0.2" in package.json
Then, do/follow the manual installation guide for android on this link.

@jayrparro getting this error after upgrading the package:
FAILURE: Build failed with an exception.

* Where:
  Build file '/Users/Projects/MyApp/node_modules/react-native-vector-icons/android/build.gradle' line: 4
  line no. 4 is => google()

did you get this error too :

  • Where:
    Build file 'D:\workspace\iosReactTest2\node_modules\react-native-vector-icons\android\build.gradle' line: 4
  • What went wrong:
    A problem occurred evaluating project ':react-native-vector-icons'.

Could not find method google() for arguments [] on repository container.

Yes i am getting same error

@nikhilbhavsar07
Copy link

It worked for me.
Upgrade "react-native-vector-icons": "^6.0.2" in package.json
Then, do/follow the manual installation guide for android on this link.

This worked for me. Did not do manual installation - even installing using npm and then using react-native to link automatically caused this error to go away.

Hi @randomco have you changed distributionUrl to https://services.gradle.org/distributions/gradle-4.4-all.zip

@chrisk8er
Copy link

https://jcenter.bintray.com/com/android/tools has been removed from production, so unless that was a mistake and they put it back, this is a temp workaround to get you back up and running until a fix is out from this library or jcenter.

@phanvinh876
Copy link

phanvinh876 commented Dec 11, 2018

It worked for me.
First, i added google() into 2 repositories in android/build.gradle.
Then i changed dependencies to classpath 'com.android.tools.build:gradle:3.1.0'
Then i changed distributionUrl in android/gradle/wrapper/gradle-wrapper.properties to distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
Hopefully this way can help.

@randomco
Copy link

randomco commented Dec 11, 2018 via email

@nikhilbhavsar07
Copy link

It worked for me.
First, i added google() into 2 repositories in android/build.gradle.
Then i changed dependencies to classpath 'com.android.tools.build:gradle:3.1.0'
Then i changed distributionUrl in android/gradle/wrapper/gradle-wrapper.properties to distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
Hopefully this way can help.

thanks man this worked for me

@kerwin-ly
Copy link

kerwin-ly commented Dec 11, 2018

As google removed gradle v2.2.* from jcenter.So many plugins not work.It's works for me if you dont want to upgrade your packages or gradle.in your android/build.gradle, add these line

buildscript { ... }
allprojects { ... }
subprojects {
    if (
        project.name.contains('react-native-vector-icons') ||
        project.name.contains('react-native-fetch-blob')) {
        buildscript {
            repositories {
                jcenter()
                maven { url "https://dl.bintray.com/android/android-tools/"  }
            }
        }
    }
}

https://stackoverflow.com/a/53718971/7510338

@DaniloT
Copy link

DaniloT commented Dec 11, 2018

If you use icons that are no longer available in the most recent version, follow the instructions in this package readme to install them as a custom font. Mostly, they can be just replaced with similar ones, but it is up to you.

Updating the package is the best fix option, and updating your own gradle is needed to use the versions above 6. This should be done anyway, as the older gradle versions are being deprecated for a reason, so only attempt another fix if you really have a problem with updating your gradle.

divs1210 pushed a commit to simpledotorg/simple-experiments that referenced this issue Dec 12, 2018
* WIP: six-digit-id

* Goto relevant screen after entering six digit id

* Bugfix: patient search via sdid

* Remove unused card status

* Fix: association confirmation at wrong times, bring back :pending

* Bugfix: handle-six-digit-input was overwriting db

* Associate six digit id with existing patient after scan screen

* Bugfix: abstract out has-six-digit-id? and dedup code

* Register new patient with six-digit-id when no results are found

* Bugfix: six-digit-id should lead to search page when no results are found

* Bugfix: associate six-digit-id with patient when registering

* Search results page cleanup

- show Add Card to Patient header only when pending association
- cleanup old search results in six digit id flow

* Update react-native-vector-icons to fix intermittent build error

Info: oblador/react-native-vector-icons#605

* Search results: show back arrow

* Minor refactoring to address comments on PR
@ShridharCodewave
Copy link

Getting the same issue from today. Any solution?

@ghost
Copy link

ghost commented May 29, 2019

@amitbravo Yes, It's internet problem. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests