繁体   English   中英

如何将react-native-vector-icons链接到项目

[英]How to link react-native-vector-icons to project

我使用react-native-icons获得了构建错误。 我从他们的github站点的安装说明中完成了链接命令。 消息称图标已经与项目相关联。

Ld /Users/rsanchez/Library/Developer/Xcode/DerivedData/NativeStarter-ddtqngxgxoergggtejjrwdqafazh/Build/Products/Debug-iphonesimulator/NativeStarter.app/NativeStarter normal x86_64 cd /Users/rsanchez/Development/NativeStarter.git/ios export IPHONEOS_DEPLOYMENT_TARGET = 7.0 export PATH =“/ Applications / Xcode.app / Contents / Developer / Platforms / iPhoneSimulator.platform / Developer / usr / bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/ usr / local / 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/iPhoneSimulator9.2.sdk -L / Users / rsanchez / Library / Developer / Xcode / DerivedData / NativeStarter -ddtqngxgxoergggtejjrwdqafazh / Build / Products / Debug-iphonesimulator -F / Users / rsanchez / Library / Developer / Xcode / DerivedData / NativeStarter -ddtqngxgxoergggtejjrwdqafazh / Build / Products / Debug-iphonesimulator -filelist / Users / rsanc hez / Library / Developer / Xcode / DerivedData / NativeStarter-ddtqngxgxoergggtejjrwdqafazh / Build / Intermediates / NativeStarter.build / Debug-iphonesimulator / NativeStarter.build / Objects-normal / x86_64 / NativeStarter.LinkFileList -Xlinker -rpath -Xlinker @ executable_path / Frameworks - mios-simulator-version-min = 7.0 -Xlinker -objc_abi_version -Xlinker 2 -ObjC -fobjc-arc -fobjc-link-runtime -lRNVectorIcons / Users / rsanchez / Library / Developer / Xcode / DerivedData / NativeStarter -ddtqngxgxoergggtejjrwdqafazh / Build / Products /Debug-iphonesimulator/libReact.a /Users/rsanchez/Library/Developer/Xcode/DerivedData/NativeStarter-ddtqngxgxoergggtejjrwdqafazh/Build/Products/Debug-iphonesimulator/libRCTActionSheet.a / Users / rsanchez / Library / Developer / Xcode / DerivedData / NativeStarter -ddtqngxgxoergggtejjrwdqafazh / Build / Products / Debug-iphonesimulator / libRCTGeolocation.a /Users/rsanchez/Library/Developer/Xcode/DerivedData/NativeStarter-ddtqngxgxoergggtejjrwdqafazh/Build/Products/Debug-iphonesimulator/libRCTImage.a/ Users / rsanchez / L ibrary / Developer / Xcode / DerivedData / NativeStarter-ddtqngxgxoergggtejjrwdqafazh / Build / Products / Debug-iphonesimulator / libRCTLinking.a / Users / rsanchez / Library / Developer / Xcode / DerivedData / NativeStarter -ddtqngxgxoergggtejjrwdqafazh / Build / Products / Debug-iphonesimulator / libRCTNetwork。 a /Users/rsanchez/Library/Developer/Xcode/DerivedData/NativeStarter-ddtqngxgxoergggtejjrwdqafazh/Build/Products/Debug-iphonesimulator/libRCTSettings.a / Users / rsanchez / Library / Developer / Xcode / DerivedData / NativeStarter-ddtqngxgxoergggtejjrwdqafazh / Build / Products / Debug-iphonesimulator / libRCTText.a /Users/rsanchez/Library/Developer/Xcode/DerivedData/NativeStarter-ddtqngxgxoergggtejjrwdqafazh/Build/Products/Debug-iphonesimulator/libRCTVibration.a / Users / rsanchez / Library / Developer / Xcode / DerivedData / NativeStarter- ddtqngxgxoergggtejjrwdqafazh / Build / Products / Debug-iphonesimulator / libRCTWebSocket.a -Xlinker -dependency_info -Xlinker / Users / rsanchez / Library / Developer / Xcode / DerivedData / NativeStarter-ddtqngxgxoergggtejjrwdqafa zh / Build / Intermediates / NativeStarter.build / Debug-iphonesimulator / NativeStarter.build / Objects-normal / x86_64 / NativeStarter_dependency_info.dat -o / Users / rsanchez / Library / Developer / Xcode / DerivedData / NativeStarter-ddtqngxgxoergggtejjrwdqafazh / Build / Products /调试iphonesimulator / NativeStarter.app / NativeStarter

ld:找不到-lRNVectorIcons clang的库:错误:链接器命令失败,退出代码为1(使用-v查看调用)

我们更新了Native Starter Pro的文档。 请查看常见问题解答中的第一个问题

http://strapmobile.com/docs/native-starter-pro/faqs/

概率:

  • 如果您的系统中安装了“npm3”,则可能会出现问题。
  • 确保您已安装'npm2'。
  • 链接XCode中的矢量图标repo将解决该问题

解决方案1:拖放以链接RN矢量图标文件:

  • 在您的取景器/计算机中,导航到(项目文件夹) - > node_modules - > react-native-vector-icons
  • 将RNVectorIcons.xcodeproj拖动到侧栏中的Libraries,如下图所示 在此输入图像描述

解决方案2:手动链接RN矢量图标文件:

  • 转到Xcode中的“Build Phases”
  • 通过单击“+”链接二进制文件与库
  • 点击“添加其他”
  • 导航到'NativeStarter'(项目文件夹) - > node_modules - > react-native-vector-icons
  • 选择'RNVectorIcons.xcodeproj'
  • 清洁构建
  • 再建一次

我所做的只是关注github中的文档。

我只是运行rnpm link ,它没有手动操作。

请确保您已安装'rnpm'

npm install rnpm -g

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM