AirLabsTeam / react-native-aws-cognito-js

React Native AWS Cognito JS SDK
Other
134 stars 19 forks source link

On Android - TypeError: undefined is not an object (evaluating 'RNAWSCognito.computeModPow') #13

Closed ramki1979 closed 7 years ago

ramki1979 commented 7 years ago

I am using authenticateUser on iOS and Android.

iOS is working fine. I am running into TypeError: undefined is not an object (evaluating 'RNAWSCognito.computeModPow') on android.

Anything I am missing here.

jmparsons commented 7 years ago

I would just make sure to run react-native link to make sure the android gradle file is set properly.

ramki1979 commented 7 years ago

I have used react-native link, all other functions related to AWS userpool of the lib are working in android.

gastonconcilio commented 7 years ago

I am having the same issue for iOS, only seen it when running authenticateUser so far.

TypeError: Cannot read property 'computeModPow' of undefined

gastonconcilio commented 7 years ago

Never mind - I had my Linked Frameworks and Libraries messed up.

jmparsons commented 7 years ago

@ramki1979 Please try running the example Android project. If that works on your side, then I'd just say double check your version, wipe node modules etc. Let me know if it works for you.

ramki1979 commented 7 years ago

@jmparsons I wil try it today and reply back.

ramki1979 commented 7 years ago

I am using React-Native-Navigation from Wix, so I have to add the Package list myself in the MainApplication.java And I somehow missed added the

new RNAWSCognitoPackage()

This might be the problem. As @jmparsons mentioned to relook at react-native link should have solved my problem. But some how I didn't find the packagelist missing this library.

I am only able to find after comparing Example project with mine and wondering how I missed that.

Thanks @jmparsons @gastonconcilio for quick reply.

chinloongtan commented 7 years ago

I encountered this issue as well. What I did was drag RNAWSCognito.xcodeproj to my xcode project libraries and add libRNAWSCognito.a to Build Phases. (Basically manually linking it). Hope this information helps someone in the future.

Twitchkidd commented 6 years ago

I had this same problem and what I missed that I had to do was run pod install after react-native link as that had added pod 'RNAWSCognito', :path => '../node_modules/amazon-cognito-identity-js' to Podfile automatically, but I hadn't installed it, and sure enough: Installing JKBigInteger2 (0.0.5) Installing RNAWSCognito (1.29.0) showed up in my terminal and now I've got user authentication flow on iOS and Android. Yay!