模块RNPaypalWrapper错误Apple-Mach-O链接器反应本机错误
Posted
技术标签:
【中文标题】模块RNPaypalWrapper错误Apple-Mach-O链接器反应本机错误【英文标题】:Module RNPaypalWrapper error Apple-Mach-O linker Error in react native 【发布时间】:2019-04-19 13:31:30 【问题描述】:大家好,我在安装 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 导出 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-Simulated.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 -正常/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)
我该如何解决这些错误......
【问题讨论】:
您没有正确设置,请重新完成所有过程 这就是为什么我告诉你是否有任何工作示例或 github 示例..你也可以分享这个..并且检查信用卡支付是否有效? 【参考方案1】:这些是软件包的安装说明,请仔细执行每一步。
-
npm install --save react-native-paypal-wrapper 或 yarn add
react-native-paypal-wrapper
react-native 链接 react-native-paypal-wrapper
clone this repo(您不需要此 repo 中的所有组件 你下载选择性)
添加 PayPalMobile 目录(包含几个 .h 文件和 libPayPalMobile.a) 到您的 Xcode 项目。我们建议检查 “复制项目...”并选择“创建组...”。
在项目的构建设置中(在 TARGETS 部分,而不是 项目部分):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 documentation 它们非常适合我们的项目
【讨论】:
以上是关于模块RNPaypalWrapper错误Apple-Mach-O链接器反应本机错误的主要内容,如果未能解决你的问题,请参考以下文章
模块“Alamofire”是为不兼容的目标 arm64 - apple- ios 10 创建的
找不到目标'x86_64-apple-ios-simulator'的模块'MyCustomFramework';找到:arm64,armv7-apple-ios,arm