0

I'm using the iOS SDK through Fabric for AWS and getting a crash. When running the app I get a crash on this line:

dataset = AWSCognito.defaultCognito().openOrCreateDataset("fabricExample")

The crash says:

fatal error: unexpectedly found nil while unwrapping an Optional value

This is the code I have, the same as from the Fabric SDK:

https://fabric.io/kits/ios/amazon/features

I made sure that I “Enable access to unauthenticated identities” in AWS. Not sure what I'm doing wrong. Does it have to do with the database?

Has anyone used Fabric to install AWS? Can't find any questions on that.

Thanks in advance.

Lukesivi
  • 2,206
  • 4
  • 25
  • 43
  • I got it working by creating a new project and NOT using Fabric. I installed the AWS SDK through cocoa pods and then added the frameworks necessary that are in the AWS tutorial. Still strange though that it doesn't work with Fabric... – Lukesivi Feb 02 '16 at 14:51
  • Are you using the Fabric plugin to import the AWS SDK? Or CocoaPods? Does your `info.plist` contain `AWSDefaultRegionType`, `AWSCognitoIdentityRegionType`, and `AWSCognitoIdentityPoolId` keys? Also, do you know what version of Fabric and AWS SDK you are using? – Yosuke Feb 02 '16 at 20:58
  • I'm using Fabric plugin. The plist did contain those three you mentioned. I'm using the current version of Fabric. Now, it works when using cocoa pods and then manually added the frameworks. But it didn't work with Fabric which is weird. @YosukeMatsuda – Lukesivi Feb 03 '16 at 13:11

1 Answers1

0

You haven't set the defaultCognito.

The fabric sample code sets this in your appDelegate

Carl
  • 2,896
  • 2
  • 32
  • 50