Module RNPaypalWrapper error Apple-Mach-O linker Error in react native

筅森魡賤 提交于 2020-01-05 07:12:19

问题


Hey guys Im making an app of react native after installing react native payola wrapper im facing this issues

  1. Module RNPaypalWrapper requires main queue setup since it overrides constantsToExport but doesn't implement requiresMainQueueSetup. In a future release React Native will default to initializing all native modules on a background thread unless explicitly opted-out of.

  2. Apple-Mach-O linker Error

 Ld /Users/mac/Library/Developer/Xcode/DerivedData/Shopping-bffzrhylanxuelcazupfwylbgyoq/Build/Products/Debug-iphonesimulator/Shopping.app/Shopping

normal 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-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-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)

how can I resolve these errors......


回答1:


these are the installation instruction for the package do every step carefully.

  1. npm install --save react-native-paypal-wrapper or yarn add react-native-paypal-wrapper
  2. react-native link react-native-paypal-wrapper
  3. clone this repo ( You do not need all the components in this repo you download selectives )

  4. Add the PayPalMobile directory (containing several .h files and libPayPalMobile.a) to your Xcode project. We recommend checking "Copy items..." and selecting "Create groups...".

  5. In your project's Build Settings (in the TARGETS section, not the PROJECTS section):
add -lc++ -ObjC to Other Linker Flags
enable Enable Modules (C and Objective-C)
enable Link Frameworks Automatically
  1. In your project's Build Phases, link your project with these libraries. Weak linking for iOS versions back to 6.0 is supported.
Accelerate.framework
AudioToolbox.framework
AVFoundation.framework
CoreLocation.framework
CoreMedia.framework
MessageUI.framework
MobileCoreServices.framework
SystemConfiguration.framework
SafariServices.framework
  1. Add the open source license acknowledgments from acknowledgments.md to your app's acknowledgments.

  2. In your app's Info.plist, add the following URL schemes to LSApplicationQueriesSchemes:

com.paypal.ppclient.touch.v1
com.paypal.ppclient.touch.v2
org-appextension-feature-password-management

Note: These installation instructions were collected from react-native-paypal-wrapper and also as it suggested the paypal ios sdk documentation they were perfect for our projects



来源:https://stackoverflow.com/questions/53336526/module-rnpaypalwrapper-error-apple-mach-o-linker-error-in-react-native

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!