简体   繁体   English

react-native-vector-icons Android

[英]react-native-vector-icons Android

I sucessfully imported icons into iOS and Android by the following: 我通过以下方式成功将图标导入了iOS和Android:

npm i --save react-native-vector-icons

react-native link

add: apply from: "../../node_modules/react-native-vector-icons/fonts.gradle" to build.gradle 添加: apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"到build.gradle

However, after closing my Android emulator and returning to the project I am no longer able to view these icons. 但是,在关闭我的Android仿真器并返回到项目之后,我不再能够查看这些图标。 I've tried rm -rf node_modules && npm i as well as going through the above process but can no longer view these icons on Android (iOS is unaffected and working). 我已经尝试了rm -rf node_modules && npm i以及通过了上述过程,但是无法再在Android上查看这些图标(iOS不受影响并且可以使用)。 I am also starting the emulator before using react-native run-android . 在使用react-native run-android之前,我也正在启动模拟器。 I've even tried to run the Android emulator after removing the vector icons and I can't get anything to run on Android. 在删除矢量图标后,我什至尝试运行Android模拟器,但无法在Android上运行任何东西。

My current error reads: "A problem occurred configuring project ':react-native-vector-icons'." 我当前的错误为:“配置项目':react-native-vector-icons'时出现问题。”

What am I missing? 我想念什么? Why would it work and then after closing and reopening the project, no longer work? 为什么它会起作用,然后在关闭并重新打开项目后不再起作用? 在此处输入图片说明

Part of my build.gradle file: 我的build.gradle文件的一部分:

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "com.rncardreplacement"
        minSdkVersion 16
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }

Pretty sure the issue was that you had gradle 2.2 installed and the project was setup to 1.1.3 like you get in the errors. 可以肯定的问题是,您已经安装了gradle 2.2,并且像遇到错误一样将项目设置为1.1.3。

For example this is the gradle file of one of my modules: 例如,这是我的模块之一的gradle文件:

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

But this is another module: 但这是另一个模块:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法建立Android应用程式react-native-vector-icons:releaseCompileClasspath - Can not build android app react-native-vector-icons:releaseCompileClasspath 使用 react-native-vector-icons 图标未显示在屏幕 android 上 - Icon not displaying on screen android using react-native-vector-icons 使用react-native-vector-icons的图标未显示在android屏幕上 - Icon not displaying on android screen using react-native-vector-icons react-native-vector-icons导致android build问题 - react-native-vector-icons causing issues with android build react-native-vector-icons 或 @expo/vector-icons 未在 Android 设备上呈现 - react-native-vector-icons or @expo/vector-icons not rendering on android device react-native-vector-icons 中的错误,Icons 是日文的 - Bug in react-native-vector-icons, Icons is in japanese 不从 react-native-vector-icons/FontAwesome 加载图标 - Not loading Icons from react-native-vector-icons/FontAwesome 错误:react-native-vector-icons:compileDebugJavaWithJavac'。 反应母语 - Error : react-native-vector-icons:compileDebugJavaWithJavac'. React-Native react-native-vector-icons /羽毛图标未显示 - react-native-vector-icons/Feather icons are not displayed react-native-vector-icons/react-native-elements 不起作用 - react-native-vector-icons/ react-native-elements not working
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM