1

I'm facing the following error when trying to run

react-native run android

The console acuses:

  • What went wrong:

A problem occurred configuring project ':react-native-vector-icons'.

> Could not resolve all files for configuration ':react-native-vector-icons:classpath'.

> Could not find any matches for com.android.tools.build:gradle:2.3.+ as no versions of com.android.tools.build:gradle are available.

Searched in the following locations: https://jcenter.bintray.com/com/android/tools/build/gradle/maven-metadata.xml https://jcenter.bintray.com/com/android/tools/build/gradle/

Required by: project :react-native-vector-icons

3 Answers3

2

Changing the version of react-native-vector-icons did the trick

I actually found the answer in this post: react native vector icons

Made it work by making a change in the package.json file.

Changed the line:

"react-native-vector-icons": "^5.0.0",

To:

"react-native-vector-icons": "^6.1.0",
  • The way how you solve it is to update react-native to a higher version which does not use AGP 2.2.3. If you want to stick to the older version of react-native 5.0.0, you can use the workaround I provided https://stackoverflow.com/a/53734791/8034839 – shizhen Dec 12 '18 at 01:31
0

Check it here: https://stackoverflow.com/a/53734791/8034839

Try to add this to your build.gradle file.

subprojects {
    if (project.name.contains('react-native-vector-icons')) {
        buildscript {
            repositories {
                jcenter()
                maven { url "https://dl.bintray.com/android/android-tools/"  }
            }
        }
    }
}
shizhen
  • 12,251
  • 9
  • 52
  • 88
0
  1. Try updating react-native-vector-icons.
  2. If you don't want to update change classpath version to 2.2.3 instead of 2.3.+
Rajat Gupta
  • 1,864
  • 1
  • 9
  • 17