react-native-vector-icons not showing properly on android version 30-32

184 Views Asked by At

Why is my react-native-vector-icons not showing properly? This happens on SDK version 30 to 32, 33 is the only version that is working properly.

Below is the details of sdk version in my android project

buildscript {
    ext {
        buildToolsVersion = "31.0.0"
        minSdkVersion = 21
        compileSdkVersion = 31
        targetSdkVersion = 31
        ndkVersion = "21.4.7075529"
    }
...
}

package.json

"react-native-vector-icons": "^9.2.0"
"react": "18.2.0"
"react-native": "^0.69.1"

i tried this approach but still fails

app/build.gradle

apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"

settings.gradle

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

I also tried various approach like downgrade the icons libraries, ./gradlew clean and run android, but still nothing good comes up, anyone have ideas how to solve this?

1

There are 1 best solutions below

2
Rarer On

Have you tried "@expo/vector-icons" ,'react-native-vector-icons/MaterialCommunityIcons'; or You can also go to android/app/build.gradle and add like this

apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"

then use command to manually link that like this

npx react-native link react-native-vector-icons

then check if linking the react-native-vector-icons module to React Native done or not May be in newer versions issue not remains anymore..