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.45k stars 2.12k forks source link

Getting CUICatalog: Invalid asset name supplied: (null) warning #192

Closed insraq closed 4 years ago

insraq commented 8 years ago

Hi,

I am getting CUICatalog: Invalid asset name supplied: (null) warning in XCode console when using Icon.TabBarItem.

I am running React Native 0.25.1 and Vector Icon 1.3.4

Any idea?

oblador commented 8 years ago

Did you do a full integration? Did you check that the icon name actually exists? What code are you trying with?

insraq commented 8 years ago

After some debug, I have found out the warning come from Icon.getImageSource. The icon shows up and works, It's just the warning shows up in the XCode console. I believe it's related to how the Icon.TabBarItem works. Since getImageSource works in async way, there may be cases where null is supplied to <TabBarIOS.item icon={this.state.icon} />.

I have only integrate Ionicon and everything else works. I haven't used React Native Vector Icon with previous React Native versions. I don't know whether it's a new thing or not.

oblador commented 8 years ago

I'm not getting this in the TabBarExample project using simulator and icon should not be set at all until it's generated. Can you provide the code you are seeing this with?

insraq commented 8 years ago

I've tried copying index.ios.js from TabBarExample to my project. And I can still see the warning (see attached). So the problem is not in JS side.

I have tried remove node_modules folder and re-integrate the libraries, using rnpm and manually, still no luck. I guess there must be some hidden flags in XCode that I mess up?

image

insraq commented 8 years ago

I have tried 1.3.4 and 2.0. Both have warnings. I have also tried TabBarExample, I did not get any warnings either.

oblador commented 8 years ago

When you upgraded to 0.25, did you also run react-native upgrade? Does this happen with a fresh project?

insraq commented 8 years ago

I did run react-native upgrade. However the warning is still there. I have also tried to use the template XCode project file and re-link all the libraries - Still no luck.

oblador commented 8 years ago

If you want me to debug this I need a way to reproduce the warning. My guess is that you're using an icon that was removed with Ionicons 3.0.0.

insraq commented 8 years ago

I am testing with 1.3.4 (have tested both actually). The icon shows up alright though.

oblador commented 8 years ago

Yep, then it's something else then :-) Did you try if it happens with a new project using react-native init?

insraq commented 8 years ago

After wasting a whole day debugging this, I have found out how to reproduce it. So what I did was a clean react-native init and copy my JS files to the new project. It works without warning. So I thought there must be something missing in my current XCode project file, since it was created in the 0.8 era of React Native. After I set up the project in XCode side, the warning appeared again!

So I did a react-native init again. This time I made sure I did a clean and rebuild after each step in XCode. I found out the step that causes the warning was creating an Image Set in Images.xcassets, which was used in the launch screen. I went a step further to test whether it is the Images Set itself or the fact that it was used by launch screen. And I believe as long as there is an image in the Image Set, the warning will appear, regardless of whether it's used or not.

I am also able to reproduce it in the TabBar example, simply by adding an Image Set (with image).

image

yushroom commented 8 years ago

same problem

DenisIzmaylov commented 8 years ago

Up!

messense commented 7 years ago

Same issue.

szholdiyarov commented 4 years ago

Closing this issue due to inactivity. If you also getting that warning, please feel free to reopen the issue.