如果是原生和RN混合开发,首先执行以下代码:
yarn add react-native-fast-image
然后在Android添加依赖:
1.在android/settings.gradle里增加代码:
include ':react-native-fast-image'
project(':react-native-fast-image').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fast-image/android')
2.在android/app/build.gradle里增加代码:
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
+ implementation project(':react-native-fast-image')
}
3.在android/app/src/main/java