2015-05-08 15 views
5

Ho creato un progetto nativo reattivo utilizzando react-native init Quindi aggiungo un'estensione di azione a quel progetto utilizzando File -> nuovo -> destinazione -> Azione Extension, con il nome "Stash" provo l'aggiunta di uno StashView che eredita da UIView, e contiene un RCTRootView, come indicato nella Integration with Existing App instructions:Simboli indefiniti per architettura x86_64: dopo aver aggiunto un obiettivo estensione a un progetto nativo reattivo

Stash/StashView.h:

#import <UIKit/UIKit.h> 

@interface StashView : UIView 

@end 

Stash/StashView .m:

#import "StashView.h" 
#import "RCTRootView.h" 

@implementation StashView 
- (void)awakeFromNib { 
    NSString *urlString = @"http://localhost:8081/stash.ios.bundle"; 
    NSURL *jsCodeLocation = [NSURL URLWithString:urlString]; 
    RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation 
                 moduleName: @"Stash" 
                launchOptions:nil]; 
    [self addSubview:rootView]; 
    rootView.frame = self.bounds; 
} 
@end 

Quando compilo, ottengo l'errore:

Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_RCTRootView", referenced from: objc-class-ref in StashView.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

La piena analisi dello stack:

Ld /Users/danoved/Library/Developer/Xcode/DerivedData/ToDoBox-gmtanlmumdrkqactpypioaempcuc/Build/Products/Debug-iphonesimulator/Stash.appex/Stash normal x86_64 cd /Users/danoved/Source/myprojects/ToDoBox export IPHONEOS_DEPLOYMENT_TARGET=8.1 export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk -L/Users/danoved/Library/Developer/Xcode/DerivedData/ToDoBox-gmtanlmumdrkqactpypioaempcuc/Build/Products/Debug-iphonesimulator -F/Users/danoved/Library/Developer/Xcode/DerivedData/ToDoBox-gmtanlmumdrkqactpypioaempcuc/Build/Products/Debug-iphonesimulator -filelist /Users/danoved/Library/Developer/Xcode/DerivedData/ToDoBox-gmtanlmumdrkqactpypioaempcuc/Build/Intermediates/ToDoBox.build/Debug-iphonesimulator/Stash.build/Objects-normal/x86_64/Stash.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @executable_path/../../Frameworks -Xlinker -objc_abi_version -Xlinker 2 -OjbC /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/PrivateFrameworks/PlugInKit.framework/PlugInKit -e _NSExtensionMain -fobjc-arc -fobjc-link-runtime -fapplication-extension -Xlinker -no_implicit_dylibs -mios-simulator-version-min=8.1 -Xlinker -dependency_info -Xlinker /Users/danoved/Library/Developer/Xcode/DerivedData/ToDoBox-gmtanlmumdrkqactpypioaempcuc/Build/Intermediates/ToDoBox.build/Debug-iphonesimulator/Stash.build/Objects-normal/x86_64/Stash_dependency_info.dat -o /Users/danoved/Library/Developer/Xcode/DerivedData/ToDoBox-gmtanlmumdrkqactpypioaempcuc/Build/Products/Debug-iphonesimulator/Stash.appex/Stash

Che cosa sto facendo di sbagliato? Qualcosa nelle impostazioni di compilazione?

risposta

7

Capito!

Sulla base del answer here

ho dovuto aprire il binario di collegamento con le librerie carota nelle fasi di creazione della proroga, e aggiungere tutte le librerie reagire ad esso:

enter image description here

Problemi correlati