2

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.o
ld: symbol(s) not found for architecture arm64
clang: 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:

  1. Clean and re-archive the project
  2. Delete cached data in DerivedData
  3. Update Cocopods to 1.9.0
  4. Downgrade Xcode to 11.4
  5. Change Build Active Architecture Only to YES 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.

Kenta. K
  • 91
  • 4
  • 11

1 Answers1

0

I could finally archive the project successfully following this answer: Undefined symbols for architecture arm64 - JSClassCreate

Steps:

  1. Select your project name in the project navigator
  2. Select your target that is having this issue
  3. Find "Valid Architectures" under "Build Setting" > "Architectures"
  4. Remove "arm64 & arm7" from "Valid Architectures" from the relevant scheme
  5. Compile your project with release mode
Kenta. K
  • 91
  • 4
  • 11
  • I cannot seem to find Valid Architectures under Build Settings > Architectures. Is it possible if you share a screenshot on where it is? – Heru S Mar 23 '21 at 11:19
  • The option seems to be deprecated in Xcode 12 according to https://stackoverflow.com/questions/63259053/xcode-12-beta-valid-architectures-missing-in-build-settings/63259096. – Kenta. K Mar 31 '21 at 19:28