LunatiqueCoder / luna

Luna - a React Native + Next.js template. Built with TypeScript :heart:
https://luna-gamma.vercel.app/
MIT License
264 stars 17 forks source link

Luna vector icons inclusion style on android not compatible with react-native-vector-icons 9.1.0+ ? (android build fail duplicate resources) #49

Closed mikehardy closed 2 years ago

mikehardy commented 2 years ago

Describe the bug

Right now luna (and react-native-firebase-authentication-example) have react-native-vector-icons fonts in android/app/src/main/assets/fonts and we include the react-native-vector-icons build.gradle reference in the tail end of android/app/buld.gradle

In v9.1.0 of react-native-vector-icons they have changed how they do the build-time copy of fonts on android, and the build for apps based on this template breaks on duplicate resource errors.

Root cause appears to be that they are copied to a different (but still valid location now) and it was only working in the past (inclusion + copy) because the copy was overwriting the included fonts, resulting in a coincidentally working build

https://github.com/oblador/react-native-vector-icons/issues/1416#issuecomment-1038978635

Maintainer says:

You should pick one approach, either manually copying them to your fonts folder, or copying on build with gradle. To fix this error simply remove the duplicates in packages/public-app/android/app/src/main/assets/fonts, they are most likely out of date anyways.

Seems like we should remove the fonts from android/app/src/main/fonts and just rely on the build-time copy, I think? That will result in fonts that are up to date by default.

Also apparently the fonts themselves are updated, so if they have been copied out to web or to ios and committed outside of the react-native-vector-icons module, they should be removed there if at all possible and reference the module's up to date contents

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

LunatiqueCoder commented 2 years ago

Thank you so much Mike! I really appreciate ALL of your work around the internet ❤️

I recently changed my job and I'm extremely busy but I'll definitely try to pay more attention to Luna in the upcoming period.

mikehardy commented 2 years ago

No worries - wish I had more time to fix issues (that is, propose PRs) instead of just logging them. I need to fix this in my template as well so I will be through with a PR before too long. In the meantime hope the job change is positive and as with all things open source, if you have the time great, if not, no pressure. Cheers