react / react/react-native

Undefined symbol: _OBJC_CLASS_$_RCTRootView - Linker command failed with exit code 1 (use -v to see invocation)

Abierto
#44,749 0 comentarios 3 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Issue: Author Provided Repro Needs: Triage :mag:
Lenguaje dominante
C++
Estrellas
127k
Forks
25.3k
Merge medio
1 d 23 h
PR fusionados (30 d)
4

Descripción

Description

I am trying to create Intent Extension but encountering an issue when building my project where the linker command fails with the following error message:

Showing All Issues
Undefined symbol: OBJC_CLASS$_RCTRootView
Linker command failed with exit code 1 (use -v to see invocation)

Steps to reproduce
  1. Clone the repository and navigate to the project directory.
  2. Run yarn
  3. Open the .xcworkspace file in Xcode.
  4. Select the extension scheme and build target.
  5. Attempt to build the project using Xcode.
React Native Version

0.74.1, & 0.72.4,

Affected Platforms

Runtime - iOS

Output of npx react-native info
System:
  OS: macOS 14.4.1
  CPU: (8) arm64 Apple M1 Pro
  Memory: 822.47 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.9.0
    path: ~/.nvm/versions/node/v20.9.0/bin/node
  Yarn:
    version: 1.22.19
    path: ~/.nvm/versions/node/v20.9.0/bin/yarn
  npm:
    version: 10.1.0
    path: ~/.nvm/versions/node/v20.9.0/bin/npm
  Watchman:
    version: 2024.03.25.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/ahmed.quraishi/.rvm/gems/ruby-3.0.0/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.4
      - iOS 17.4
      - macOS 14.4
      - tvOS 17.4
      - visionOS 1.1
      - watchOS 10.4
  Android SDK:
    API Levels:
      - "28"
      - "29"
      - "30"
      - "31"
      - "33"
      - "34"
    Build Tools:
      - 29.0.2
      - 30.0.3
      - 33.0.0
      - 34.0.0
    System Images:
      - android-29 | Google APIs ARM 64 v8a
      - android-30 | Google APIs ARM 64 v8a
      - android-31 | Google APIs ARM 64 v8a
      - android-31 | Google Play ARM 64 v8a
      - android-33 | Google TV ARM 64 v8a
      - android-33 | Google APIs ARM 64 v8a
      - android-34 | Google APIs ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2023.1 AI-231.9392.1.2311.11076708
  Xcode:
    version: 15.3/15E204a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.9
    path: /usr/bin/javac
  Ruby:
    version: 3.0.0
    path: /Users/ahmed.quraishi/.rvm/rubies/ruby-3.0.0/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.74.1
    wanted: 0.74.1
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false
Stacktrace or Logs
Showing All Errors Only

Build target IntentExt of project extension with configuration Debug

Ld /Users/ahmed.quraishi/Library/Developer/Xcode/DerivedData/extension-hambbgmbepieztcxuctphmpiupmc/Build/Products/Debug-iphonesimulator/IntentExt.appex/IntentExt normal (in target 'IntentExt' from project 'extension')
    cd /Users/ahmed.quraishi/Desktop/Projects/extension/ios
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -Xlinker -reproducible -target arm64-apple-ios17.4-simulator -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.4.sdk -O0 -L/Users/ahmed.quraishi/Library/Developer/Xcode/DerivedData/extension-hambbgmbepieztcxuctphmpiupmc/Build/Intermediates.noindex/EagerLinkingTBDs/Debug-iphonesimulator -L/Users/ahmed.quraishi/Library/Developer/Xcode/DerivedData/extension-hambbgmbepieztcxuctphmpiupmc/Build/Products/Debug-iphonesimulator -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.4.sdk/usr/lib/swift -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -F/Users/ahmed.quraishi/Library/Developer/Xcode/DerivedData/extension-hambbgmbepieztcxuctphmpiupmc/Build/Intermediates.noindex/EagerLinkingTBDs/Debug-iphonesimulator -F/Users/ahmed.quraishi/Library/Developer/Xcode/DerivedData/extension-hambbgmbepieztcxuctphmpiupmc/Build/Products/Debug-iphonesimulator -F/Users/ahmed.quraishi/Desktop/Projects/extension/ios/Pods/hermes-engine/destroot/Library/Frameworks/universal -F/Users/ahmed.quraishi/Library/Developer/Xcode/DerivedData/extension-hambbgmbepieztcxuctphmpiupmc/Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/hermes-engine/Pre-built -filelist /Users/ahmed.quraishi/Library/Developer/Xcode/DerivedData/extension-hambbgmbepieztcxuctphmpiupmc/Build/Intermediates.noindex/extension.build/Debug-iphonesimulator/IntentExt.build/Objects-normal/arm64/IntentExt.LinkFileList -Xlinker -rpath -Xlinker /usr/lib/swift -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @executable_path/../../Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/ahmed.quraishi/Library/Developer/Xcode/DerivedData/extension-hambbgmbepieztcxuctphmpiupmc/Build/Intermediates.noindex/extension.build/Debug-iphonesimulator/IntentExt.build/Objects-normal/arm64/IntentExt_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -e _NSExtensionMain -fapplication-extension -fobjc-link-runtime -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -L/usr/lib/swift -Xlinker -add_ast_path -Xlinker /Users/ahmed.quraishi/Library/Developer/Xcode/DerivedData/extension-hambbgmbepieztcxuctphmpiupmc/Build/Intermediates.noindex/extension.build/Debug-iphonesimulator/IntentExt.build/Objects-normal/arm64/IntentExt.swiftmodule -lc++ -lc++abi -licucore -framework Accelerate -framework AudioToolbox -framework CFNetwork -framework JavaScriptCore -framework MobileCoreServices -framework Security -framework UIKit -framework hermes -ObjC -lc++ -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/ahmed.quraishi/Library/Developer/Xcode/DerivedData/extension-hambbgmbepieztcxuctphmpiupmc/Build/Intermediates.noindex/extension.build/Debug-iphonesimulator/IntentExt.build/IntentExt.appex-Simulated.xcent -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __ents_der -Xlinker /Users/ahmed.quraishi/Library/Developer/Xcode/DerivedData/extension-hambbgmbepieztcxuctphmpiupmc/Build/Intermediates.noindex/extension.build/Debug-iphonesimulator/IntentExt.build/IntentExt.appex-Simulated.xcent.der -framework PassKit -lPods-IntentExt -Xlinker -no_adhoc_codesign -Xlinker -dependency_info -Xlinker /Users/ahmed.quraishi/Library/Developer/Xcode/DerivedData/extension-hambbgmbepieztcxuctphmpiupmc/Build/Intermediates.noindex/extension.build/Debug-iphonesimulator/IntentExt.build/Objects-normal/arm64/IntentExt_dependency_info.dat -o /Users/ahmed.quraishi/Library/Developer/Xcode/DerivedData/extension-hambbgmbepieztcxuctphmpiupmc/Build/Products/Debug-iphonesimulator/IntentExt.appex/IntentExt

ld: warning: ignoring duplicate libraries: '-lc++'
Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_RCTRootView", referenced from:
       in IntentHandler.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Undefined symbol: _OBJC_CLASS_$_RCTRootView

Linker command failed with exit code 1 (use -v to see invocation)



Build failed 
Reproducer

https://github.com/AhmadQuraishi/RNExtensionIssue.git

Screenshots and Videos
image

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Usa el reproductor de RNExtensionIssue enlazado y abre su iOS .xcworkspace en Xcode. Compila el esquema IntentExt y, a continuación, inspecciona la referencia de IntentHandler.o a RCTRootView y los pods y frameworks vinculados de la extensión. La tarea estará terminada cuando el target IntentExt se enlace correctamente sin el error de símbolo no definido.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
ios, react-native
Área
mobile
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.