votrai123 / integrate-multiple-react-native

8 stars 4 forks source link

Error when using custom font in MiniApp #9

Closed hookie256 closed 8 months ago

hookie256 commented 8 months ago

In mini app, I use Inter-Medium font, I place font and image in one folder parent named "assets" When I run this command "npx react-native bundle --platform ios --dev false --entry-file index.js --bundle-output ../../ios/index.ios-1.bundle --assets-dest ../../ios --reset-cache" -> Only images copied, file Inter-Medium.ttf not copied When I run in SuperApp, I got an error: Unrecognized font family 'Inter-Medium' in XCode log. So What was I wrong? and how to do next to make app run?. Thanks!

votrai123 commented 8 months ago

I think the font will be used consistently throughout the project. You can add it manually to Xcode and Android Studio. @hookie256

hookie256 commented 8 months ago

sr, but another error appears and I don't know how to solve this: when I run my mini app, it appears in logs: I am sure that I place "MyApp" in appName in App.tsx file in superapp Invariant Violation: "MyApp" has not been registered. This can happen if:

votrai123 commented 8 months ago

I think it's not due to a font issue.

hookie256 commented 8 months ago

yep, I solved font issue, we dont care about font issue now, but another issue, when I create a new project, and I import my MiniApp project in miniapp folder, that error appears...could you know why it happened?

votrai123 commented 8 months ago

It might be conflicting with Metro . Try stopping all running Metro instances (includes: clear cache yarn) and then rebuild.