Comments (27)
Thanks @brentvatne, for helping resolve my issue.
For anyone else with the same problem, it was a combination of two factors:
-
I was using AppRegistry.registerComponent, which is no longer necessary. With CRNA you can also get away without calling registerComponent, as it assumes you are building whatever is the default export from "/ROOT/App.js". In short, @jayeszee nailed the problem.
-
In my "app.json", I specified an "expo.appKey", which looked for the name of the registered component. With this specified, I couldn't remove registerComponent or the app would look for the registerComponent key, and fail to build.
from vector-icons.
I have a similar babelrc. Could do coffee tomorrow, just send me a message on Twitter.
from vector-icons.
@brentvatne @ShMcK so i did a bit of digging and it seems like the error is due to the fact that my app which was created a while ago still used
AppRegistry.registerComponent
which crna already does for us now. I went over and created a new crna app and just copied some of the initial configurations that differed like exporting my app instead of manually registering the component and now it seems to be happy.
from vector-icons.
error doesn't really make sense, nothing changed that would impact this. try updating again, should be fine. if not working, try clearing node_modules and installing again
from vector-icons.
oh -- are you using babel-preset-expo?
from vector-icons.
Yes, with some additional presets.
{
"presets": [
"babel-preset-expo",
"react-native-dotenv"
],
"env": {
"development": {
"plugins": [
"transform-react-jsx-source"
]
}
}
}
from vector-icons.
I've tried resetting modules, clearing the npm cache, etc. The only thing that worked was rolling back.
from vector-icons.
@ShMcK - any chance you can share your repo? or repro it on another repository?
from vector-icons.
Unfortunately, its private. I'll try to duplicate the issue in a separate repo.
from vector-icons.
thanks!
from vector-icons.
I created a smaller repo, but couldn't replicate the problem.
I'm certain the issue exists, at least for me alone, as changing back and forth from v6.2 to v6.1 recreates the issue.
Looking at the library commits, I'm also not sure what may have changed. And following the code within the node_modules, everything in Javascript land checks out
According to the "react-native-vector-icons" docs, when facing a similar error message, take the following steps. Unfortunately, none of these actions are available when using Expo.
Red screen with "Unrecognized font family" error on iOS
- Make sure you've added manually the reference of your .ttf on your xcodeproj Resources folder.
- Check that the font you are trying to use appears in Info.plist, if you've added the whole folder and it's blue in color, then you need to add it to the path.
- Check that the font is copied in the Copy Bundle Resources in Build Phases.
- Recompile the project.
from vector-icons.
@ShMcK - if you're unable to repro it on another project, the only thing we could do is have you send me your project and I can investigate. That said, it almost certainly has nothing to do with this library updating because the changes from 6.1 to 6.2 would not have impacted that, and it seems like a coincidence that changing versions causes this problem. There must be something else that is interacting in your project to cause the problem. If you need me to sign a NDA or whatever that's fine.
from vector-icons.
I have the same problem upgrading from 5.0.0 -> 6.2 I get 'unrecognized font family: material' but same error really.
Update: 6.1 is also broken for me. 5.2 works.
from vector-icons.
Me too! I upgraded from 5.1 to 6.2 and it broke.
Edit: looks like downgrading to 6.1 made it work...
from vector-icons.
@brentvatne, let me know if you'd like a hands on version to debug. Happy to comply :)
from vector-icons.
@brentvatne @ShMcK found the issue. its this 2f496ed reverting these 4 lines makes it work.
from vector-icons.
@ShMcK - haha that would be good! :) maybe grab a coffee and do this tomorrow?
@jayeszee @ShMcK - do you have babel-preset-expo
in .babelrc
?
from vector-icons.
from vector-icons.
@jayeszee - can you share your app source with me?
from vector-icons.
@brentvatne sorry unfortunately I too am on a private repo =/ I can say that it does work on a fresh new crna app though.
from vector-icons.
I see! You should use Expo.registerRootComponent
-- perhaps we need to give a warning if people register their applications through AppRegistry.registerComponent
rather than Expo.registerRootComponent
(which wraps the former in order to get rid of a redundant string argument in the first param and do some initialization work).
from vector-icons.
I haven't had the same success with AppRegistry.registerComponent.
Thanks @jayeszee, I'll try again tomorrow with your recipe of generating a new CRNA app and migrating the configuration over.
from vector-icons.
I have break it at version 6.3.1 and now, I can not fixed, because it's integrated in expo, version 27.0.1.
Any one can help me! Thank you!
from vector-icons.
@shamanking, check the capitalization on ionicons. I believe it should be "Ionicons".
from vector-icons.
Thanks @ShMcK, I do it as @jayeszee and it works. My error arise when I detach expo to the exist project.
from vector-icons.
THANK YOU. I've been trying for ages. The trick was the registerRootComponent
.
from vector-icons.
I'm pretty sure I started my project with expo init
and have never needed to register components in any way. But the app won't run on an actual iOS device unless I add AppRegistry.registerComponent('main',() => App)
.
As noted, this causes the error with the Fonts (although the error doesn't appear on the device, it just shows no icons; in Expo the error can simply be
Using Expo.registerRootComponent
(and main
key in package.json
) does indeed fix the Font problem, but then, without the AppRegistry
line, I'm back to where I started and the app won't load on a device.
Is there a way to fix this?
from vector-icons.
Related Issues (20)
- Icons do not show in APK when building using Expo EAS HOT 5
- [iOS/iPadOS] - icons do not load successfully HOT 1
- [Web] Icons not showing when using metro bundler HOT 3
- typo: cirlce -> circle
- Remove unused icon sets HOT 1
- error An unexpected error occurred:
- [Web] Selectable prop is deprecated HOT 1
- New Twitter (X) icon HOT 1
- Support for FontAwesome v6 HOT 5
- @expo/vector-icon is not showing up in Android build version sdk 49 HOT 3
- Specify size and color in the style of NativeWind HOT 1
- Filled EvilIcons
- Some FontAwesome6 Icons are broken in @expo/[email protected] HOT 2
- Some icons are not aligned properly.
- Why is the latest version (14.0.0) not published yet? HOT 2
- Feature Request (Add Bootstrap Icons)
- "Possible Unhandled Promise Rejection" warned by @expo/vector-icons component HOT 9
- Support generic Icon component with ‘type’ prop
- [Web] Issues when using Google Translate
- [Android, Development Build, SDK 50, monorepo] Icons do not show up HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vector-icons.