I am facing an issue with archiving my React Native project for the production scheme on Xcode. The app is able to run on my real device, however, archiving the project always fails with the following error.
Undefined symbols for architecture arm64:"_RCTSharedApplication", referenced from: -[MyAppTests testRendersWelcomeScreen] in MyAppTests.old: symbol(s) not found for architecture arm64clang: error: linker command failed with exit code 1 (use -v to see invocation)
It was working just fine until a few weeks ago, and it still works just fine for the staging scheme. It just suddenly stopped working.Although I tried the following things so far, I got no luck.
What I tried so far:
- Clean and re-archive the project
- Delete cached data in DerivedData
- Update Cocopods to 1.9.0
- Downgrade Xcode to 11.4
- Change
Build Active Architecture Only
toYES
following this answer: How solve 'Undefined symbols for architecture armv7' in React Native iOS?
My current environment is:
- OS: macOS Catalina Version 10.15.4
- Xcode: Version 11.4.1
- React Native: Version 0.61.2
- Cocopods: Version 1.9.0
I am stuck in this problem for a while now. Any help would be deeply appreciated.