简体   繁体   中英

Xcode 8.0 beta give an error after import Firebase

I create empty swift project with Xcode 8.0 beta 5 or 6 and import Firebase with use cocoapods like Firebase guidelines. Everythings fine while import process. I configure firebase with FIRApp.Configure() comment. I can handle with Authentication but when I try to reach database it didn't work.

Build time error in FIRApp.h like :

"Conflicting nullability specifier on return types, 'nullable' conflicts with existing specifier 'non null'"

Screenshot of FIRApp.h Build-time error

Also these kind of error in the console:

2016-08-26 13:00:32.719: <FIRInstanceID/WARNING> STOP!! Will reset deviceID from memory.
2016-08-26 13:00:32.719: <FIRInstanceID/WARNING> Failed to fetch default token Error Domain=com.firebase.iid Code=6 "(null)"

2016-08-26 13:02:08.329: <FIRInstanceID/WARNING> Failed to retrieve the default GCM token after 5 retries

I couldn't solve the problem.

The build time warning is related to Xcode 8 updates in nullability declaration checking. It should be innocuous and fixed in an upcoming release.

The FIRInstanceID errors are related to a keychain bug in the Xcode 8 beta. See this radar . The keychain problem only impacts simulator runs. There should be a fix before the beta ends. In the meantime, the workaround is to enable keychain sharing (see Benjamin's answer) or to use a real device.

The keychain bug is fixed in Xcode 8.2.

Actually it is not related to any sort of bug but to the fact your Keychain Sharing is off by default and you need to enable it.

From the Project Navigator , select the target . Under the Capabilities tab , turn on Keychain Sharing . This should get rid of all the issues.

Build time warnings can be fixed this way.
Go to your Pods -> Build Settings -> Use Legacy Swift Language Version and set it to No , this worked for me.

Clean your project and build.

I was able to reproduce the warnings and fix on multiple occasions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM