2017-08-07 1 views
0

Je crée une application iOS avec React Native. Ce faisant, j'ai installé un react-native module et configuré mon projet iOS xcode (principalement des cocoapodes) en suivant le tutoriel du module. Maintenant, quand je lance react-native run-ios, je reçois cette pile d'erreur:React La version native d'iOS a échoué: symboles non définis pour l'architecture x86_64

Undefined symbols for architecture x86_64:

"_JSNoBytecodeFileFormatVersion", referenced from:

+[RCTJavaScriptLoader loadBundleAtURL:onProgress:onComplete:] in RCTJavaScriptLoader.o

+[RCTJavaScriptLoader attemptSynchronousLoadOfBundleAtURL:runtimeBCVersion:sourceLength:error:] in RCTJavaScriptLoader.o "facebook::react::IRemoteConnection::~IRemoteConnection()", referenced from:

RemoteConnection::~RemoteConnection() in RCTInspector.o "facebook::react::parseTypeFromHeader(facebook::react::BundleHeader const&)", referenced from:

+[RCTJavaScriptLoader attemptSynchronousLoadOfBundleAtURL:runtimeBCVersion:sourceLength:error:] in RCTJavaScriptLoader.o

"facebook::react::customJSCWrapper()", referenced from:

-[RCTDevSettings isJSCSamplingProfilerAvailable] in RCTDevSettings.o

-[RCTDevSettings toggleJSCSamplingProfiler] in RCTDevSettings.o ____ZL11getInstancev_block_invoke in RCTInspector.o

_RCTNSErrorFromJSErrorRef in RCTJSCErrorHandling.o

-[RCTSamplingProfilerPackagerMethod handleRequest:withResponder:] in RCTSamplingProfilerPackagerMethod.o

"facebook::react::systemJSCWrapper()", referenced from:

-[RCTDevSettings isJSCSamplingProfilerAvailable] in RCTDevSettings.o

-[RCTDevSettings toggleJSCSamplingProfiler] in RCTDevSettings.o

_RCTNSErrorFromJSErrorRef in RCTJSCErrorHandling.o

-[RCTSamplingProfilerPackagerMethod handleRequest:withResponder:] in RCTSamplingProfilerPackagerMethod.o

ld: symbol(s) not found for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **

The following build commands failed:

Ld /Users/antoine/R/devlab/ReactNative/medway-twilio/MedwayTwilio/ios/build/Build/Products/Debug-iphonesimulator/React/React.framework/React normal x86_64 (1 failure)

Je soupçonne que cela est lié à l'inclusion des bibliothèques et des cadres du projet avec Xcode, mais je ne suis pas sûr.

Ce une capture d'écran de mon objectif de projet/construction phases/lien binaire avec panneau bibliothèques dans Xcode:

Libraries

Où « MedwayTwilio » est mon nom de projet

+0

Pouvez-vous me montrer plus d'informations, la partie de la bibliothèque vous projet iOS par exemple –

+0

Avez-vous essayez d'exécuter lien natif réagir? –

+0

@JulienKode J'ai ajouté une capture d'écran si c'est ce que vous avez demandé. Le lien reac-native indique que ma bibliothèque est déjà liée. –

Répondre

4

Est-ce que vous avez configuré votre CocoaPods dépendances comme décrit in the documentation?

De plus, vous devez ajouter une dépendance au sous-programme RCTBatchedBridge (si vous utilisez la version 0.46) ou RCTCxxBridge (s'il est plus récent).

pod 'React', :path => '../node_modules/react-native', :subspecs => [ 
    'Core', 
    'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43 
    [...] 
    'BatchedBridge', # Include if RN = 0.46 
    'CxxBridge' # Include if RN >= 0.47 
    ] 
+0

Je ne vois pas '' CxxBridge '# Inclure si RN> = 0.47' dans la documentation – AlxVallejo

+0

L'ajout du sous-système' BatchedBridge 'm'a permis de résoudre ce problème. – BillyRayCyrus