Undefined symbols for architecture arm64 - JSClassCreate

前端 未结 2 411
天命终不由人
天命终不由人 2020-12-24 11:13

I am getting Undefined symbols for architecture arm64 when building react-native application in release variant. I deployed the app last month on the store

相关标签:
2条回答
  • 2020-12-24 11:29

    Make sure JavaScriptCore.framework is added to Link Binary With Libraries

    0 讨论(0)
  • 2020-12-24 11:48

    I found a similar problem when I compile a release version to target "Test". (Didn't encounter when compile to a debug version)

    Undefined symbols for architecture arm64:
      "_RCTSetLogFunction", referenced from:
          -[citieswegoTests testRendersWelcomeScreen] in citieswegoTests.o
    ld: symbol(s) not found for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    

    I try to remove options "arm64 & arm7" from the "valid Architectures" in target "Tests" and the problem is resolved. Hope this help.

    1. Change the "select a project or target" e.g Tests.
    2. remove "arm64 & arm7" from "valid Architectures"
    3. compile your project with release mode.
      SDKs:
        iOS SDK:
          Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3
      IDEs:
        Xcode: 10.3/10G8 - /usr/bin/xcodebuild
      npmPackages:
        react: 16.8.6 => 16.8.6 
        react-native: 0.60.5 => 0.60.5 
      npmGlobalPackages:
        react-native-cli: 2.0.1
        react-native-git-upgrade: 0.2.7
        react-native-macos-cli: 2.0.1
    
    0 讨论(0)
提交回复
热议问题