【发布时间】:2018-12-12 18:46:53
【问题描述】:
我在我的 react native 项目中使用了矢量图标,它做得很好,但是在为 android 平台进行构建 (react-native run-android) 的几个小时之前,我收到了这个错误。
添加矢量图标的步骤如下:
npm install react-native-vector-icons –save
反应原生链接
谁能帮忙解决这个问题?
FAILURE: Build failed with an exception.
* 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
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 7s
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html
【问题讨论】:
-
请把 react-native-vector-icons 升级到最新版本,因为已经发布了一个版本来解决这个问题(4.6.1 应该可以工作)。
-
Android Studio 的事件日志有问题吗?
-
这是 vs 代码中的问题。
标签: react-native npm