unimonkiez / react-native-asset

Linking and unlinking of assets 🔥
302 stars 52 forks source link

Incorrect file path for font assets on iOS #43

Open TheHeumanModean opened 1 year ago

TheHeumanModean commented 1 year ago

Context

used ignite boilerplate this potentially changes iOS folder structure

Steps to reproduce

Steps that I did to fix

before

197A7A355453429EBCF9A29A /* ttf-file-name.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "ttf-file-name.ttf"; path = "../assets/fonts/font-name/ttf-file-name.ttf"; sourceTree = "<group>"; };

after

197A7A355453429EBCF9A29A /* ttf-file-name.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "ttf-file-name.ttf"; path = "../../assets/fonts/font-name/ttf-file-name.ttf"; sourceTree = "<group>"; };
morwalz commented 1 year ago

I have same problem. App builds but fonts do not work in ios. When i apply this fix, build start to fail.

unimonkiez commented 1 year ago

Not sure what the problem is, happily merge whatever PR you do to fix this

cayleyh commented 1 year ago

The problem here is that the cordova-node-xcode library's project.addResourceFile() is to add the resource as "Relative to Group" in Xcode, which is "/Resources".

I'm investigating if there is an option on addResourceFile() that can set it relative to the project. I'll have a PR with a potential solution for discussion shortly.