Open jamespearson opened 7 years ago
I have the same issue. I responded originally thinking I had fixed it, but I didn't. :(
Hi @FearMediocrity @michaelcuneo,
@FearMediocrity you are importing AWSCognitoCredentials
but are calling ASCognitoCredential
which is undefined. (note the missing W
)?
I have the same issue. Android. Real device (Samsung S6). Are there things missing from the README. Do we need to add external libraries (the Android AWS SDK) to make this work? They are mentinoned for iOS but not Android.
This fixed the issue (a bad installation more likely) for Android. Add this line compile 'com.amazonaws:aws-android-sdk-core:2.2.+' in the dependencies of android/app/build.gradle if it's not there.
[How I got there: I went to my node_modules/aws-sdk-react-native-core/android/build.gradle saw this: dependencies { compile 'com.facebook.react:react-native:+' compile 'com.amazonaws:aws-android-sdk-core:+' } From there, I got to this http://docs.aws.amazon.com/mobile/sdkforandroid/developerguide/setup.html
used option 1 (my IDE is not Android Studio but I do use it) and voilà! :)]
@appwiz I am having same issue on iOS... cognitoClient.initWithOptions(options) in AWSCognitoCredentials.js is undefined. Obviously native code not being found. When you say... Did you download the respective framework from the AWS iOS SDK? What does your header search path look like?
...can you give a little more detail on how to set those up properly.
I copied appropriate frameworks in iOS/Frameworks in my node_modules and then did xcode build which it said succeeded, but still having this issue. I would assume if build succeeded the header paths are good.
I also found an initial issue in AWSCognitoCredentials.js it had async {callbackId}, I changed to async (callbackId)
Maybe my answer here can help : https://github.com/awslabs/aws-sdk-react-native/issues/24#issuecomment-267746814
Trying to use Cognito, and following the example code, I end up with:
XCode produces the following error:
[fatal][tid:com.facebook.react.RCTExceptionsManagerQueue] Unhandled JS Exception: Cannot read property 'initWithOptions' of undefined
A little debugging, and it appears that in AWSCogniteCredentials.js the following returned: undefined.
var cognitoClient = NativeModules.AWSRNCognitoCredentials;