Error Message in Debug Area

With every playground that runs in Xcode 7.0 beta 5, the following three errors display in the debug area:

Aug 6 13:11:50 Tour1[17353] <Error>: CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.

Aug 6 13:11:50 Tour1[17353] <Error>: CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.

Aug 6 13:11:50 Tour1[17353] <Error>: CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.


How do I fix this? How do I set the environmental variables and what do I set them to?

Replies

still happens in xcode 7 GM , i do not use hidden status bar, can we ignore this warning?

I have the same problem. I does not use Status Bar but I used NONE option inside Storyboard.

You may ignore this warning.

Still in iOS 9 GM edition !!!!!

I am getting the following errors in Playground with the latest Xcode 7 GM, OS X 10.11 GM and iOS 9 GM, any possible solution to get rid of them?


Sep 9 21:59:09 SwiftPlayground[1045] <Error>: CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.

Sep 9 21:59:09 SwiftPlayground[1045] <Error>: CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.

Sep 9 21:59:09 SwiftPlayground[1045] <Error>: CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.

Hey Guys, I got a fix for this issue


Go to your app-info.plist.


find


UIViewControllerBasedStatusBarAppearance


and remove that row.


That fix my problem

I have the same issue in Xcode 7 GM...

I was very worried xD

Remove

UIViewControllerBasedStatusBarAppearance (View controller-based status bar appearance)
from Info.plist fixed it for me.

Removing UIViewControllerBasedStatusBarAppearance will not be able to get my status bar hidden.

Removing UIViewControllerBasedStatusBarAppearance removes the error display, however I think it's related to the UIApplication statusBar methods deprecations. I don't see any replacements for them. I've never been able to see a light status bar without that key.


https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UIApplication_Class/index.html#//apple_ref/doc/uid/TP40006728-CH3-SW170

Hi,

I encounter this problem too, at the starting of APP after upgrading to xcode 7.

After all, i found the reason of problem, custom font - Helvetica Neue was used in some xibs of the project. I replace the custom font by system font, everything is ok.

I hope my reply would help someone with the same problem.


John from 360.

I get this error as soon as I open a new blank iOS playground in Xcode 7 GM

I get this with XCode7 and iOS9 release.


I can't remove UIViewControllerBasedStatusBarAppearance because then the status bar returns!

xcode7 official release, ios9 project, same problem

If View controller-based status bar appearance is NO, just replace to YES.

Just that.


Tnks.