ios - 模块RNPaypalWrapper错误Apple-Mach-O链接器反应本机错误
问题描述
嘿伙计们,我在安装 react native payola wrapper 后制作了一个 react native 应用程序,我面临这个问题
模块 RNPaypalWrapper 需要主队列设置,因为它覆盖
constantsToExport
但没有实现requiresMainQueueSetup
. 在未来的版本中,React Native 将默认在后台线程上初始化所有本机模块,除非明确选择退出。Apple-Mach-O 链接器错误
Ld /Users/mac/Library/Developer/Xcode/DerivedData/Shopping-bffzrhylanxuelcazupfwylbgyoq/Build/Products/Debug-iphonesimulator/Shopping.app/Shopping
正常 x86_64 cd /Users/mac/Desktop/Tanveer/Tabtest/Shopping/ios export IPHONEOS_DEPLOYMENT_TARGET=9.0 export PATH="/Applications/Xcode_9.4.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin: /Applications/Xcode_9.4.1.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Applications/Xcode_9.4.1.app/Contents /Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode_9.4.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4。sdk -L/Users/mac/Library/Developer/Xcode/DerivedData/Shopping-bffzrhylanxuelcazupfwylbgyoq/Build/Products/Debug-iphonesimulator -L/Users/mac/Desktop/Tanveer/Tabtest/Shopping/ios/Pods/CardIO/CardIO - L/Users/mac/Desktop/Tanveer/Tabtest/Shopping/ios/Pods/PayPal-iOS-SDK/PayPalMobile-F/Users/mac/Library/Developer/Xcode/DerivedData/Shopping-bffzrhylanxuelcazupfwylbgyoq/Build/Products/Debug- iphonesimulator -filelist /Users/mac/Library/Developer/Xcode/DerivedData/Shopping-bffzrhylanxuelcazupfwylbgyoq/Build/Intermediates.noindex/Shopping.build/Debug-iphonesimulator/Shopping.build/Objects-normal/x86_64/Shopping.LinkFileList -Xlinker - rpath -Xlinker @executable_path/Frameworks -mios-simulator-version-min=9.0 -Xlinker -object_path_lto -Xlinker /Users/mac/Library/Developer/Xcode/DerivedData/Shopping-bffzrhylanxuelcazupfwylbgyoq/Build/Intermediates。noindex/Shopping.build/Debug-iphonesimulator/Shopping.build/Objects-normal/x86_64/Shopping_lto.o -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -ObjC -lCardIO -lPayPalMobile -lc++ -lopencv_core -lopencv_imgproc -framework AVFoundation -framework Accelerate -framework AudioToolbox -framework CoreLocation -framework CoreMedia -framework CoreVideo -framework MessageUI -framework MobileCoreServices -framework OpenGLES -framework QuartzCore -framework Security -framework SystemConfiguration -framework UIKit -ObjC -lc++ - Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/mac/Library/Developer/Xcode/DerivedData/Shopping-bffzrhylanxuelcazupfwylbgyoq/Build/Intermediates.noindex/Shopping.build/Debug-iphonesimulator/Shopping.build/Shopping.app-模拟。xcent /Users/mac/Library/Developer/Xcode/DerivedData/Shopping-bffzrhylanxuelcazupfwylbgyoq/Build/Products/Debug-iphonesimulator/libRCTBlob.a /Users/mac/Library/Developer/Xcode/DerivedData/Shopping-bffzrhylanxuelcazupfwylbgyoq/Build/Products/ Debug-iphonesimulator/libRCTAnimation.a /Users/mac/Library/Developer/Xcode/DerivedData/Shopping-bffzrhylanxuelcazupfwylbgyoq/Build/Products/Debug-iphonesimulator/libReact.a /Users/mac/Library/Developer/Xcode/DerivedData/Shopping- bffzrhylanxuelcazupfwylbgyoq/Build/Products/Debug-iphonesimulator/libRCTAnimation.a /Users/mac/Library/Developer/Xcode/DerivedData/Shopping-bffzrhylanxuelcazupfwylbgyoq/Build/Products/Debug-iphonesimulator/libRCTActionSheet.a /Users/mac/Library/Developer/ Xcode/DerivedData/Shopping-bffzrhylanxuelcazupfwylbgyoq/Build/Products/Debug-iphonesimulator/libRCTGeolocation。a /Users/mac/Library/Developer/Xcode/DerivedData/Shopping-bffzrhylanxuelcazupfwylbgyoq/Build/Products/Debug-iphonesimulator/libRCTImage.a /Users/mac/Library/Developer/Xcode/DerivedData/Shopping-bffzrhylanxuelcazupfwylbgyoq/Build/Products/ Debug-iphonesimulator/libRCTLinking.a /Users/mac/Library/Developer/Xcode/DerivedData/Shopping-bffzrhylanxuelcazupfwylbgyoq/Build/Products/Debug-iphonesimulator/libRCTNetwork.a /Users/mac/Library/Developer/Xcode/DerivedData/Shopping- bffzrhylanxuelcazupfwylbgyoq/Build/Products/Debug-iphonesimulator/libRCTSettings.a /Users/mac/Library/Developer/Xcode/DerivedData/Shopping-bffzrhylanxuelcazupfwylbgyoq/Build/Products/Debug-iphonesimulator/libRCTText.a /Users/mac/Library/Developer/ Xcode/DerivedData/Shopping-bffzrhylanxuelcazupfwylbgyoq/Build/Products/Debug-iphonesimulator/libRCTVibration。a /Users/mac/Library/Developer/Xcode/DerivedData/Shopping-bffzrhylanxuelcazupfwylbgyoq/Build/Products/Debug-iphonesimulator/libRCTWebSocket.a -lRNImagePicker -lRNPaypalWrapper -lPods-Shopping -Xlinker -dependency_info -Xlinker /Users/mac/Library/ Developer/Xcode/DerivedData/Shopping-bffzrhylanxuelcazupfwylbgyoq/Build/Intermediates.noindex/Shopping.build/Debug-iphonesimulator/Shopping.build/Objects-normal/x86_64/Shopping_dependency_info.dat -o /Users/mac/Library/Developer/Xcode/ DerivedData/Shopping-bffzrhylanxuelcazupfwylbgyoq/Build/Products/Debug-iphonesimulator/Shopping.app/Shoppinga -lRNImagePicker -lRNPaypalWrapper -lPods-Shopping -Xlinker -dependency_info -Xlinker /Users/mac/Library/Developer/Xcode/DerivedData/Shopping-bffzrhylanxuelcazupfwylbgyoq/Build/Intermediates.noindex/Shopping.build/Debug-iphonesimulator/Shopping.build/对象-normal/x86_64/Shopping_dependency_info.dat -o /Users/mac/Library/Developer/Xcode/DerivedData/Shopping-bffzrhylanxuelcazupfwylbgyoq/Build/Products/Debug-iphonesimulator/Shopping.app/Shoppinga -lRNImagePicker -lRNPaypalWrapper -lPods-Shopping -Xlinker -dependency_info -Xlinker /Users/mac/Library/Developer/Xcode/DerivedData/Shopping-bffzrhylanxuelcazupfwylbgyoq/Build/Intermediates.noindex/Shopping.build/Debug-iphonesimulator/Shopping.build/对象-normal/x86_64/Shopping_dependency_info.dat -o /Users/mac/Library/Developer/Xcode/DerivedData/Shopping-bffzrhylanxuelcazupfwylbgyoq/Build/Products/Debug-iphonesimulator/Shopping.app/Shopping
ld: library not found for -lPods-Shopping clang: error: linker command failed with exit code 1 (use -v to see invocation)
我该如何解决这些错误......
解决方案
这些是软件包的安装说明,请仔细执行每一步。
- npm install --save react-native-paypal-wrapper 或 yarn add react-native-paypal-wrapper
- react-native 链接 react-native-paypal-wrapper
克隆这个 repo(你不需要下载这个 repo 中的所有组件)
将 PayPal Mobile 目录(包含几个 .h 文件和 libPayPalMobile.a)添加到您的 Xcode 项目中。我们建议检查“复制项目...”并选择“创建组...”。
- 在项目的构建设置中(在 TARGETS 部分,而不是 PROJECTS 部分):
add -lc++ -ObjC to Other Linker Flags enable Enable Modules (C and Objective-C) enable Link Frameworks Automatically
- 在您的项目的构建阶段,将您的项目与这些库链接。支持返回 6.0 的 iOS 版本的弱链接。
Accelerate.framework AudioToolbox.framework AVFoundation.framework CoreLocation.framework CoreMedia.framework MessageUI.framework MobileCoreServices.framework SystemConfiguration.framework SafariServices.framework
将 acknowledgments.md 中的开源许可证确认添加到应用程序的确认中。
在您应用的 Info.plist 中,将以下 URL 方案添加到 LSApplicationQueriesSchemes:
com.paypal.ppclient.touch.v1 com.paypal.ppclient.touch.v2 org-appextension-feature-password-management
注意:这些安装说明是从react-native-paypal-wrapper收集的,并且因为它建议了paypal ios sdk 文档,它们非常适合我们的项目
推荐阅读
- vue.js - 如何通过参数传递整个对象
- python - 从数据框中分配变量
- firebase - How to solve "Unhandled Exception: PlatformException(Error performing updateData, NOT_FOUND: No document to update:"
- rust - 如何在 reqwest 中的 Decode failed 错误中获取响应正文?
- python - Matplotlib 流图不同颜色
- angular - 值不会在视图中更新
- cypress - 赛普拉斯:等待不可预知的组件从专有集合中渲染?
- android - 如何在多行 TextView 的末尾添加可点击的 ImageView?
- bytecode - CPU如何执行解释语言代码?
- graphql - 数据未合并,Apollo 3 分页与字段策略