corymsmith / react-native-icons

Quick and easy icons in React Native
MIT License
1.14k stars 141 forks source link

Upgrading to react-native 0.6.0 causes Error #61

Closed alinz closed 9 years ago

alinz commented 9 years ago

Hello, After upgrading to 0.6.0, I'm getting these errors.

[error][tid:main][RCTModuleData.m:119] SMXTabBarManager is returning nil for it's methodQueue, 
which is not permitted. You must either return a pre-initialized queue, or @synthesize the 
methodQueue to let the bridge create a queue for you.

any idea?

ardalann commented 9 years ago

I added icons from this package to a project that uses React Native 0.6.0. It didn't cause any issues.

alinz commented 9 years ago

Have you tried to use the Icon or TabBar components? I don't see any problems by include the files. It starts showing errors as soon as I use Icon component.

mnylen commented 9 years ago

Weird, I started seeing this error when upgrading from 0.6 to 0.7-rc2 and to react-native master. I had to make some changes to the code in order to get react-native-icons to work.

Can you try if my branch https://github.com/mnylen/react-native-icons/tree/0.7-support works for you? Just replace the version of react-native-icons with mnylen/react-native-icons#0.7-support in package.json and npm will download my branch. Remember to restart the packager after this change.

Also, instead of doing require('FAKIconImage') or require('SMXTabBarIOS') in your code do var {FAKIconImage, SMXTabBarIOS} = require('react-native-icons') instead.

mnylen commented 9 years ago

Also, if that doesn't help, could you try modifying node_modules/react-native-icons/iOS/ReactNativeIcons/IconTabBarItem/SMXTabBarManager.m. Just add line

@synthesize methodQueue = _methodQueue;

between @synthesize bridge = _bridge; and RCT_EXPORT_MODULE() lines. After this, you must recompile the project. (Cmd+R in Xcode)

alinz commented 9 years ago

@mnylen, thanks adding @synthesize methodQueue = _methodQueue; did solve the problem. Thank you.

@corymsmith would you please take a look at this? I will keep this ticket open until some sort of solution get into the code.

ptmt commented 9 years ago

Same here. Doesn't work with current react-native/master, even with https://github.com/mnylen/react-native-icons/tree/0.7-support and the all hacks. Packager unable to resolve modules.

alinz commented 9 years ago

if you see those wringings start by Packager unable to resolve modules..., it means that all the 3rd party libraries need to be changed of how they importing core modules.

mnylen commented 9 years ago

@unknownexception Weird, it's working for me with the latest version from react-native master & my 0.7-support branch. I still see the occasional error about the methodQueue though (should probably add that also). Here's the project https://github.com/mnylen/react-native-bing-news

If you mean the "Unable to resolve module __ from _____" messages in packager output, those are to be expected with several libraries & 0.7.. Like alinz said above, it's not really an error - it's just a warning that library developers / users should stop requiring NativeModules, StyleSheet, View etc. directly and instead use the exports on react-native.

corymsmith commented 9 years ago

This should be fixed now, just accepted a PR from @brentvatne with support for RN 0.7+