Closed kirkryan closed 5 years ago
@kirkryan - Thanks for posting this. Can you post a little bit of detail on how you've configured your app? Are you using the aws-amplify-react-native authenticator component?
@haverchuck - that’s correct. This is when using the withAuthenticator HOC on iOS builds.
@kirkryan - Thanks. I think this is an expected step, but we need to update our docs.
I have also run into this issue but when trying to use the recommended fix, I get a duplicate symbols Linker Error. In my app we are not using aws-amplify-react-native component. The specific error is
duplicate symbol _OBJCCLASS$_JKBigInteger in: /Users/brady/Library/Developer/Xcode/DerivedData/traduki-ekuctotjpfcwpphgyaufmdogypjm/Build/Products/Debug-iphonesimulator/JKBigInteger2/libJKBigInteger2.a(JKBigInteger.o) /Users/brady/Library/Developer/Xcode/DerivedData/traduki-ekuctotjpfcwpphgyaufmdogypjm/Build/Products/Debug-iphonesimulator/libRNAWSCognito.a(JKBigInteger.o) duplicate symbol _OBJCMETACLASS$_JKBigInteger in: /Users/brady/Library/Developer/Xcode/DerivedData/traduki-ekuctotjpfcwpphgyaufmdogypjm/Build/Products/Debug-iphonesimulator/JKBigInteger2/libJKBigInteger2.a(JKBigInteger.o) /Users/brady/Library/Developer/Xcode/DerivedData/traduki-ekuctotjpfcwpphgyaufmdogypjm/Build/Products/Debug-iphonesimulator/libRNAWSCognito.a(JKBigInteger.o) duplicate symbol _OBJCIVAR$_JKBigInteger.m_value in: /Users/brady/Library/Developer/Xcode/DerivedData/traduki-ekuctotjpfcwpphgyaufmdogypjm/Build/Products/Debug-iphonesimulator/JKBigInteger2/libJKBigInteger2.a(JKBigInteger.o) /Users/brady/Library/Developer/Xcode/DerivedData/traduki-ekuctotjpfcwpphgyaufmdogypjm/Build/Products/Debug-iphonesimulator/libRNAWSCognito.a(JKBigInteger.o) duplicate symbol _OBJCIVAR$_JKBigDecimal.bigInteger in: /Users/brady/Library/Developer/Xcode/DerivedData/traduki-ekuctotjpfcwpphgyaufmdogypjm/Build/Products/Debug-iphonesimulator/JKBigInteger2/libJKBigInteger2.a(JKBigDecimal.o) /Users/brady/Library/Developer/Xcode/DerivedData/traduki-ekuctotjpfcwpphgyaufmdogypjm/Build/Products/Debug-iphonesimulator/libRNAWSCognito.a(JKBigDecimal.o) duplicate symbol _OBJCCLASS$_JKBigDecimal in: /Users/brady/Library/Developer/Xcode/DerivedData/traduki-ekuctotjpfcwpphgyaufmdogypjm/Build/Products/Debug-iphonesimulator/JKBigInteger2/libJKBigInteger2.a(JKBigDecimal.o) /Users/brady/Library/Developer/Xcode/DerivedData/traduki-ekuctotjpfcwpphgyaufmdogypjm/Build/Products/Debug-iphonesimulator/libRNAWSCognito.a(JKBigDecimal.o) duplicate symbol _OBJCMETACLASS$_JKBigDecimal in: /Users/brady/Library/Developer/Xcode/DerivedData/traduki-ekuctotjpfcwpphgyaufmdogypjm/Build/Products/Debug-iphonesimulator/JKBigInteger2/libJKBigInteger2.a(JKBigDecimal.o) /Users/brady/Library/Developer/Xcode/DerivedData/traduki-ekuctotjpfcwpphgyaufmdogypjm/Build/Products/Debug-iphonesimulator/libRNAWSCognito.a(JKBigDecimal.o) duplicate symbol _OBJCIVAR$_JKBigDecimal.figure in: /Users/brady/Library/Developer/Xcode/DerivedData/traduki-ekuctotjpfcwpphgyaufmdogypjm/Build/Products/Debug-iphonesimulator/JKBigInteger2/libJKBigInteger2.a(JKBigDecimal.o) /Users/brady/Library/Developer/Xcode/DerivedData/traduki-ekuctotjpfcwpphgyaufmdogypjm/Build/Products/Debug-iphonesimulator/libRNAWSCognito.a(JKBigDecimal.o) ld: 7 duplicate symbols for architecture x86_64
Run react-native unlink
It was not linked, not listed under libraries, and not listed at all in the pod file. libRNAWSCognito.a was listed under frameworks that I tried removing but that didn't help.
Did you remove it, then clean the build folder, then try to rebuild?
Yes I did clean before trying to rebuild.
I’ve just spotted that you mentioned it’s not in your pod file - that’s explains it. I had to manually add it:
#pod 'RNAWSCognito', :path => '../node_modules/amazon-cognito-identity-js'
@kirkryan Does a simple pod install
from your ios directory resolve this?
@haverchuck It does once you’ve added it to your pod file yeah!
It still is giving the same error after I added it and ran pod install and also cleaned before rebuilding
It seems my issue was with Xcode keeping old derived data, after clearing everything in DerivedData it built fine. Also I have it running fine without it in the podfile because autolinking is working fine.
@BradyShober - nice, I’ll add that to my ever growing list of tricks and fixes
@BradyShober- glad you got it working! Just to confirm, you did not need to add it to your podfile, but running pod install from the ios directory is still a necessary step?
@Ashish5591 Correct, as long as you've updated successfully to RN 0.60 or higher and have require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
and use_native_modules!
in your podfile autolinking should be working. You do still need to run pod install from the ios directory.
@kirkryan I ended up making a call out of this on our docs about this and the workaround. Please see the above PR that was merged. Closing issue as the workaround resolves this issue
This fix works for me and I can successfully build the project in Xcode. I can also run the project on the simulator via Xcode but if I try to use react-native run-ios I get the duplicate symbols error that @BradyShober mentioned above. Any ideas?
@bangersandflash Try to delete the contents of your Xcode DerivedData folder, which you can get to following the instructions here https://stackoverflow.com/questions/46468220/how-can-i-delete-derived-data-in-xcode-9 (Instructions are for Xcode 9 but it still works the same for 10). After I did that, the duplicate symbols error was fixed.
Thanks @BradyShober I've tried deleting the DerivedData contents and I'm still getting the same error. To be clear, I can build the Xcode project without any issues and run/debug it through Xcode.
I'm only seeing the compilation error when I try to run react-native run-ios from Terminal.
Same issue of @BradyShober Any solution?
I have the same error both in Android and IOS, any updates regarding this error? "react-native": "0.59.10",
I have tried fixe which was mention above, but it didn't help me.
This steps, solved my problem:
npm install amazon-cognito-identity-js
then adding pod 'RNAWSCognito', :path => '../node_modules/amazon-cognito-identity-js' in Podfile
cd ios
pod install
However, I still have a problem with Android, I'm still getting an error there, react-native link amazon-cognito-identity-js didn't help
@Ashish5591 0.59.10, in IOS
it started to work without react-native link
@bangersandflash Did you ever get it working when running react-native run-ios from Terminal.
Anyone have this issue?
Downloading dependencies Installing JKBigInteger2 (0.0.5)
[!] Error installing JKBigInteger2 [!] /usr/bin/git clone https://github.com/astruts/JKBigInteger.git /var/folders/4c/prj_vdcs0ln44y4sxdp_vp300000gp/T/d20191105-23642-e4nnc1 --template= --single-branch --depth 1 --branch 0.0.5
Cloning into '/var/folders/4c/prj_vdcs0ln44y4sxdp_vp300000gp/T/d20191105-23642-e4nnc1'... fatal: unable to access 'https://github.com/astruts/JKBigInteger.git/': Failed to connect to 10.210.250.7 port 8080: Operation timed out
I'm still having this issue even after adding pod manually as mentioned above. @Luckygirlllll how did you manage to make it work on ios?
@janoist1 Try to delete Derived data from Xcode and try once again, also check if there is any errors during pod install
@Luckygirlllll thanks for being so quick with response!
/Users/ist1/Library/Developer/Xcode/DerivedData
is empty.
There were no errors during pod install
.
I'm using Xcode Version 11.2.1 (11B500)
React: 0.61.
@janoist1 Check whether or not linking is correct in your IOS project for aws-amplify
@Luckygirlllll Ultimate fix for RN60+: pod 'RNAWSCognito', :path => '../node_modules/amazon-cognito-identity-js'
must not be added to Podfile
manually.
I had same issues with the following dependencies,
"dependencies": {
"aws-amplify": "^2.2.0",
"aws-amplify-react-native": "^2.2.3",
"react": "16.9.0",
"react-native": "0.61.5",
"react-native-gesture-handler": "^1.5.2",
"react-native-reanimated": "^1.4.0",
"react-native-screens": "^2.0.0-alpha.22",
"react-navigation": "^4.0.10"
}
I just tried $ yarn add amazon-cognito-identity-js
, and error disappeared.
"amazon-cognito-identity-js": "^3.2.1",
got error first,
(you can just ignore the RNGestureHandler
, RNReanimated
, and RNScreens
module it's related to react-navigation
)
error Could not find the following native modules: RNAWSCognito, RNGestureHandler, RNReanimated, RNScreens. Did you forget to run "pod install" ?
so I tried and error disappeared
$ cd ios
$ pod install
Detected React Native module pods for RNAWSCognito, RNGestureHandler, RNReanimated, and RNScreens
Analyzing dependencies
Downloading dependencies
Installing JKBigInteger2 (0.0.5)
Installing RNAWSCognito (3.2.1)
Installing RNGestureHandler (1.5.2)
Installing RNReanimated (1.4.0)
Installing RNScreens (2.0.0-alpha.22)
Generating Pods project
Integrating client project
Pod installation complete! There are 32 dependencies from the Podfile and 31 total pods installed.
Leaving this here for anyone who it might help.
Following the instruction on the amazon-cognito-identity-js
package readme is sufficient.
https://github.com/aws-amplify/amplify-js/tree/master/packages/amazon-cognito-identity-js
I was battling this for 3 days, full disclosure, it was my error.
The react-native link
command did not work, because I changed the package name, and did not update the android activity folder hierarchy correctly, which is required for the linking to happen.
The error thrown when linking fails, should be more conspicuous in my opinion
Installing amazon-cognito-identity-js
solves the issue but does your login persist?
I get logged out on every refresh. Some other older issues mention this and the solution was to upgrade from aws-amplify
v1 to v2. I am now on v3 doesn't persist.
I will probably try redux persist
but it seems like amplify should automatically access asyncStorage to persist login
This should be added to README documentation of aws-amplify
, especially for the React Native part.
I followed the normal README guide to install aws-amplify
but also got this error before I googled it and went here.
It should be emphasised that both aws-amplify
and amazon-cognito-identity-js
should be installed for React Native (at least for now as a workaround).
This should be added to README documentation of
aws-amplify
, especially for the React Native part. I followed the normal README guide to installaws-amplify
but also got this error before I googled it and went here. It should be emphasised that bothaws-amplify
andamazon-cognito-identity-js
should be installed for React Native (at least for now as a workaround).
My yarn install log clearly show the amazon-cognito-identity-js being added when the "@aws-amplify/auth" package is installed. More than a clarification we need a fix.
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.
Looking for a help forum? We recommend joining the Amplify Community Discord server *-help
channels or Discussions for those types of questions.
Describe the bug I hope this saves someone some time (and frustration)
A user can sign up or view the login page, but upon login, the following error is observed:
null is not an object (evaluating RNAWSCognito.computeModPow)
To Reproduce Create new >=RN0.60.0 project cd ios pod install build
Expected behavior Amplify podspec should correctly list RNAWSCognito.
Smartphone (please complete the following information):
Additional context remember not to use react-native link when working in >=0.60.0
Fix simply run the following in your project root