2
votes

I just upgrade to xCode 7 and I started to generate a simple "Hello world" react native application. However, there are the following error messages. Did someone know the reason and solution?

Sep 20 00:44:02 WeatherApp[10922] : CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. Sep 20 00:44:02 WeatherApp[10922] : CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. Sep 20 00:44:02 WeatherApp[10922] : CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. 2015-09-20 00:44:14.330 [info][tid:com.facebook.React.JavaScript] 'Running application "WeatherApp" with appParams: {"rootTag":1,"initialProps":{}}. DEV === true, development-level warning are ON, performance optimizations are OFF' 2015-09-20 00:46:14.387 [warn][tid:com.facebook.React.JavaScript] 'devtools socket closed'

2

2 Answers

2
votes

This is a bug with iOS 9.0 and the status bar API.

On iOS you can specify with whether the status bar's color should be controlled by UIViewController's preferredStatusBarStyle or by calling -[UIApplication setStatusBarStyle:]. Since React Native doesn't use view controllers, it uses the latter style of controlling the status bar color. This causes iOS 9.0 to print:

CGContextSaveGState: invalid context 0x0. If you want to see the backtrace,
please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. 

In practice the app works fine.

-1
votes

2 options:

If watchman is installed via brew, just do brew update && brew upgrade watchman

Otherwise, uninstall macports (by this guide if you're on El Capitan: How do I remove MacPorts on an "unsupported OS" i.e. El Capitan Public beta?) and reinstall watchman via brew

More info on https://github.com/facebook/react-native/issues/1875