14

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.

Bista
  • 7,869
  • 3
  • 27
  • 55
cagricalis
  • 141
  • 1
  • 4

3 Answers3

11

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.

Paul Beusterien
  • 27,542
  • 6
  • 83
  • 139
  • The keychain bug is NOT fixed in Xcode 8.2, I'm on version 11.2 and am still seeing this warning spamming my logs. – Justin Dec 03 '19 at 17:09
  • @Justin It was fixed. Likely you're seeing a reintroduction or different incarnation of a similar issue. Xcode 11 requires keychain sharing for Catalyst apps. – Paul Beusterien Dec 03 '19 at 17:45
9

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.

Benjamin
  • 8,128
  • 3
  • 34
  • 45
  • According to the docs: "Enabling keychain sharing allows your app to share passwords in the keychain with other apps developed by your team." We don't make other apps so why would I need to enable it? – Leon Jan 17 '17 at 14:50
  • Although this may not seem very clear, you are actually enabling it ti share with Firebase. Agreed, you did not develop Firebase yourself, but Firebase creates an "app" (repository) specific to your project. – Benjamin Jan 21 '17 at 13:42
  • I'm not using Firebase. – Leon Jan 22 '17 at 14:59
  • Then your comment is not really related to the question is it? However, the reason may still be the same. – Benjamin Jan 24 '17 at 09:00
0

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.

abpatil
  • 916
  • 16
  • 20