问题
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
回答1:
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",
回答2:
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/" }
}
}
}
}
回答3:
- Try updating react-native-vector-icons.
- If you don't want to update change classpath version to 2.2.3 instead of 2.3.+
来源:https://stackoverflow.com/questions/53724637/could-not-resolve-all-files-for-configuration-react-native-vector-iconsclassp