oblador / react-native-vector-icons

Customizable Icons for React Native with support for image source and full styling.
https://oblador.github.io/react-native-vector-icons/
MIT License
17.31k stars 2.12k forks source link

Fixes monorepo Android Build if only `@react-native-vector-icons/common` is Installed #1623

Closed simoncubera closed 1 month ago

simoncubera commented 1 month ago

Currently, building an Android App with the @react-native-vector-icons/common 0.0.1-alpha.6 package installed fails with the following error if no icon package is installed:

Execution failed for task ':react-native-vector-icons_common:copyFonts'.
> path may not be null or empty string. path=''

This PR filters out empty strings in build.gradle's copyFonts task, which fixes the issue.

johnf commented 1 month ago

Thanks @simoncubera

I'm curious: Do you have a use case for not having any font packages installed, or was this something you just happened to notice?

Also any feedback on the new library? Did you have any other issues?

simoncubera commented 1 month ago

Cool, thanks @johnf for the quick reaction.

I'm curious: Do you have a use case for not having any font packages installed, or was this something you just happened to notice?

Yes, I indeed have a use case for it. I'm using @react-native-vector-icons/common in an Expo project with a little wrapper script inspired by @expo/vector-icons, which allows loading fonts via Expo's asset system. That's why the common package comes in handy, as the wrapper script takes care of loading the font files.

Also any feedback on the new library? Did you have any other issues?

So far, everything seems fine, but I have not played around with it a lot, to be honest. But I generally think that it's really nice to split the package up into multiple individual packages so you only have to include what you actually use! Thanks for your work on it!