Open damathryx opened 7 years ago
I'm getting the same problem. It seems that the NativeModule for AWSCognitoCredentials isn't being registered correctly for use in the app. I can't figure out the setup quite yet but I suspect it has something to do with registering the AWS Mobile SDK and the platform specific code (.h, .m and .java) from the git repo with the project.
A complete step-by-step set up guide would be very helpful.
Edit: Maybe you can use (instead of the instructions below):
react-native link
- I just used this setting up some other module
I just reproduced the error by commenting out a line in Android native code:
I'm running with : Initial Release v0.0.1
What I had to do to fix it: In a react-native project
include ':aws-sdk-react-native-core'
project(':aws-sdk-react-native-core').projectDir = new File(rootProject.projectDir, '../node_modules/aws-sdk-react-native-core/android')
dependencies {
compile project(':aws-sdk-react-native-core')
...
}
Add import:
import com.amazonaws.reactnative.core.AWSRNCorePackage;
Add line:
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
...,
new AWSRNCorePackage() // add this line
);
}
$ react-native run-android
Post which may be overlapping: https://github.com/awslabs/aws-sdk-react-native/issues/4
When I called react-native link
it didnt seem to link the Core product to my project so I followed the 'manual linking' instructions here to get past this.
So you could:
npm install ../../path/to/aws-sdk-react-native-core-0.0.2.tgz
$(SRCROOT)/node_modules/aws-sdk-react-native-core/Core.xcodeproj
Libraries
dir/Libraries/Core.xcodeproj/Products/libCore.a
to the 'Link Library' listing you expandedSince you can interact with the Core, AWSCognitoIdentity.js
script there isnt a need to update your header paths for Cognito usage directly although the API inside there might cause me to do so.
@mnichols I tried those steps but I keep having the same error from Xcode:
That looks like header search path issue in your app's iOS project
Hi, currently I am working on Android, But I am looking for a solution for iOS as well. regarding @mnichols solution - from where I get 'aws-sdk-react-native-core-0.0.2.tgz' to install in my project? when I try @bakhansen solution 'react-native run-android' command fail because it can't delete '[ProjectName]\android\app\build\generated\source\r\debug\android\support' folder
can you help, all I want is to download file from S3
I'm getting this error on both iOS and Android![screen shot 2016-11-22 at 1 57 30 pm](https://cloud.githubusercontent.com/assets/14576761/20512695/0b89174a-b0bc-11e6-8d03-ee4aca82e7a3.png)
inside my contructor i have this![screen shot 2016-11-22 at 1 59 09 pm](https://cloud.githubusercontent.com/assets/14576761/20512729/398d2096-b0bc-11e6-9414-d97c8f2b3f33.png)
what seems to be the problem?