Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON value 'black' of type NSString cannot be converted to NSNumber #3340

Closed
ghost opened this issue Oct 11, 2015 · 9 comments
Closed

JSON value 'black' of type NSString cannot be converted to NSNumber #3340

ghost opened this issue Oct 11, 2015 · 9 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@ghost
Copy link

ghost commented Oct 11, 2015

[tid:com.facebook.React.RNVectorIconsManagerQueue]
[RCTConvert.m:55] JSON value 'black' of type NSString cannot be converted to NSNumber

@ide
Copy link
Contributor

ide commented Oct 11, 2015

Please provide more info... It's hard to tell what's going on here.

@dsibiski
Copy link
Contributor

I'm running into this as well, iOS app on v0.12.0. Using black for a color in a StyleSheet.

@dsibiski
Copy link
Contributor

Ah, look like we need to use processColor('black') to get this to work.

@Sh3rawi
Copy link

Sh3rawi commented Oct 13, 2015

Im facing this problem when using the offline bundle only; when i react-native bundle the js code and try to run it on the device i get these errors:

2015-10-13 11:38:36.693 [error][tid:com.facebook.React.ShadowQueue][RCTConvert.m:55] Error setting property 'backgroundColor' of RCTView with tag 5: JSON value 'transparent' of type NSString cannot be converted to NSNumber
2015-10-13 11:38:36.767 [error][tid:com.facebook.React.ShadowQueue][RCTConvert.m:55] Error setting property 'backgroundColor' of RCTView with tag 7: JSON value '#F5FCFF' of type NSString cannot be converted to NSNumber
2015-10-13 11:38:36.928 [error][tid:com.facebook.React.ShadowQueue][RCTConvert.m:55] Error setting property 'color' of RCTText with tag 20: JSON value '#333333' of type NSString cannot be converted to NSNumber
2015-10-13 11:38:36.968 [error][tid:com.facebook.React.ShadowQueue][RCTConvert.m:55] Error setting property 'backgroundColor' of RCTView with tag 36: JSON value '#F009F8' of type NSString cannot be converted to NSNumber
2015-10-13 11:38:36.972 [error][tid:main][RCTConvert.m:55] Error setting property 'backgroundColor' of RCTView with tag 5: JSON value 'transparent' of type NSString cannot be converted to NSNumber
2015-10-13 11:38:37.065 [error][tid:main][RCTConvert.m:55] Error setting property 'backgroundColor' of RCTView with tag 7: JSON value '#F5FCFF' of type NSString cannot be converted to NSNumber
2015-10-13 11:38:37.109 [error][tid:main][RCTConvert.m:55] Error setting property 'borderColor' of RCTTextField with tag 25: JSON value '#0F0FFF' of type NSString cannot be converted to NSNumber
2015-10-13 11:38:37.139 [error][tid:main][RCTConvert.m:55] Error setting property 'borderColor' of RCTTextField with tag 28: JSON value '#0F0FFF' of type NSString cannot be converted to NSNumber
2015-10-13 11:38:37.165 [error][tid:main][RCTConvert.m:55] Error setting property 'backgroundColor' of RCTView with tag 36: JSON value '#F009F8' of type NSString cannot be converted to NSNumber

I tried using the procesColor in the stylesheet styles but this gives errors when running the js from the localhost. Or maybe im using them the wrong way ?

@Sh3rawi
Copy link

Sh3rawi commented Oct 13, 2015

Nevermind. There was a confusion of where to get the main.jsbundle file; its created in /ios/ folder while its used in xcode in ios/project/.

@dsibiski
Copy link
Contributor

I found the solution to my problem as well, the error was coming from an outdated 3rd party lib.

@javache
Copy link
Member

javache commented Oct 13, 2015

If you're setting any colors using setNativeProps, you'll now need to pass them through processColor.

@javache javache closed this as completed Oct 13, 2015
@kushal
Copy link
Contributor

kushal commented Oct 13, 2015

Is there any hope of improving the debugging situation error for these? I'm getting a totally cryptic stacktrace and am now poking around for instances of "black" anywhere in my code or libraries.

@sloanwolf
Copy link

I was getting this as well but noticed this error in xcode log:

[tid:com.facebook.React.RNVectorIconsManagerQueue][RCTConvert.m:55] JSON value 'black' of type NSString cannot be converted to NSNumber

Upgrading "react-native-vector-icons" to the latest 0.8.4 fixed it for me.

I received this after upgrading react-native to 0.13.2.

@facebook facebook locked as resolved and limited conversation to collaborators Jul 21, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

7 participants