RN 0.56
Vector Icons 6.0.2 -> 6.1.0
Gradle: 3.1.2
Updated vector icons to latest version and now my FontAwesome (not 5) icons are not loading. I went through the trouble shooting section but it does not apply to me as I use gradle to automatically sync them. I tried everything, deleting build folders etc
Like so:
// Load our FontAwesome directly from node_modules to be in sync with updates
project.ext.vectoricons = [
iconFontNames: [ 'FontAwesome.ttf' ]
]
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
@oblador I found the problem. Upgrading Gradle to 3.2 fixed the problem but I feel like it should be documented that 6.1.0 requires Gradle 3.2 >
Same here, unfortunately I've seen this issue too late.
I've just started using this plugin and initially everything were fine. But after I've checked in the sources to git and a colleague tried the same it failed (fonts were copied during react-native link react-native-vector-icons into android/app/src/main/assets which made it work for me but not for others during development).
Unfortunately it took some time analyzing to realize that this process were broken. Additionally we were wondering where the fonts came from in android/app/src/main/assets ... my question is: should those be really copied during linking the library? If you want to copy them there, then it should probably rather happen during the build in your fonts.gradle (so those who used the automatic sync also receives the updates). If not: after upgrading the library those would be outdated because we don't relink the library again? But the up-to-date fonts would be copied to the build/intermediates directory which would be inconsistent. Which fonts gradle would prefer in this case? Still a little bit confused about how exactly this works.
If I'm wrong I'm sorry... still new to react-native and trying to learn.
Finally upgrading Android-Gradle-Plugin to 3.2.1 (using Gradle 4.10.2) fixed the issue.
Oh and indirectly you need React-Native 57.4 due to Release builds breaking cuz of new Asset change
I also had same problem with react-native v0.57.7 , FontAwesome5. All icons were X mark inside a rectangle.
Finally made it work by disabling apply from: "../../node_modules/react-native-vector-icons/fonts.gradle" line and manually copying fonts to android/app/src/main/assets/fonts
Here some failed combinations I tried;
| react-native | react-native-vector-icons | Gradle Plugin | Gradle | Result |
| ------------- | ------------- | ------------- | ------------- | ------------- |
| 0.57.7 | 6.0.2 | 3.1.4 | 4.4 | โ |
| 0.57.7 | 6.1.0 | 3.2.1 | 4.6 | โ |
| 0.57.7 | 6.1.0 | 3.2.1 | 4.10.2 | โ |
| 0.57.4 | 6.1.0 | 3.2.1 | 4.6 | โ |
| 0.57.4 | 6.1.0 | 3.2.1 | 4.10.2 | โ |
| 0.57.4 | 6.0.2 | 3.1.4 | 4.4 | โ |
Same issue
Same issue
Could you try with the repo after #923 was included? I'm not to familiar with Gradle so if someone could investigate the cause that would be ๐๐ป
Closing since fixed in latest version.
Most helpful comment
I also had same problem with react-native v0.57.7 , FontAwesome5. All icons were X mark inside a rectangle.
Finally made it work by disabling
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"line and manually copying fonts toandroid/app/src/main/assets/fontsHere some failed combinations I tried;
| react-native | react-native-vector-icons | Gradle Plugin | Gradle | Result |
| ------------- | ------------- | ------------- | ------------- | ------------- |
| 0.57.7 | 6.0.2 | 3.1.4 | 4.4 | โ |
| 0.57.7 | 6.1.0 | 3.2.1 | 4.6 | โ |
| 0.57.7 | 6.1.0 | 3.2.1 | 4.10.2 | โ |
| 0.57.4 | 6.1.0 | 3.2.1 | 4.6 | โ |
| 0.57.4 | 6.1.0 | 3.2.1 | 4.10.2 | โ |
| 0.57.4 | 6.0.2 | 3.1.4 | 4.4 | โ |