使用react-native-vectoricons时,构建失败,异常

时间:2016-07-08 10:00:45

标签: android reactjs react-native

使用react-native-vectorIcons时出现错误。我已按照https://github.com/oblador/react-native-vector-icons上的说明进行操作,但在构建项目时仍然遇到错误。

VectorIcons

这是MainActivity.java的代码

protected List<ReactPackage> getPackages() {
        return Arrays.<ReactPackage>asList(
            new MainReactPackage(),
            new VectorIconsPackage(),
            new MapsPackage(this)
        );
    }

这是settings.gradle的代码

include ':app', ':react-native-maps'
project(':react-native-maps').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-maps/android')
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')

任何人都可以告诉我这是什么问题吗?

提前致谢。

2 个答案:

答案 0 :(得分:0)

请做react-native run-android --debug一次..希望它可以帮到你。

答案 1 :(得分:0)

嘿伙计错误是由于build.gradle文件中的一些缺失行我修复了它,现在一切正常 这是缺少的行

dependencies {
    .....
    compile project(':react-native-vector-icons')
}

问题还在于我安装了版本1.10.3的react-native-vector-icons,请使用

将其更新为2.0.3
npm install --save react-native-vector-icons@2.0.3

这就是你所做的一切。欢迎质疑和质疑