For further information
- I have posted this also in https://github.com/square/in-app-payments-react-native-plugin/issues/66#issuecomment-623619907 - you can find more details there.
- The installation instructions of the package I am having problems with are in https://github.com/square/in-app-payments-react-native-plugin/blob/master/docs/get-started.md
Summarizing the problem
- The problem I am having is that I have configured a react-native package (react-native-square-in-app-payments) in Xcode, but I am getting an error saying that 'module xxx not found'.
The question, is:
- Why doesn't Xcode find the 'missing' module? What is not configured properly? Where should I look to check?
The error is the following
Module 'SquareInAppPaymentsSDK' not found
My podfile:
platform :ios, '11.0'
target 'myproject' do
use_frameworks!
pod 'React', :path => '../node_modules/react-native'
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
pod 'RNSquareInAppPayments', :path => '../node_modules/react-native-square-in-app-payments'
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == 'React'
target.remove_from_project
end
end
end
end
My project.pbxproj file (couldn't attach it here, but you can access it in github):
https://github.com/square/in-app-payments-react-native-plugin/issues/66#issuecomment-625333601
Update: Linking (following the 1st comment and @DenisTsoi answer) below
I tried automatic linking (as noted, I need it since I am using RN 0.59.9), and then I started again and tried manual linking, for both I have the same error. You can see my comments about this in https://github.com/square/in-app-payments-react-native-plugin/issues/66#issuecomment-625330210
BTW, under 'link binary with libraries' I have two entries of the package:
- SquareInAppPaymentsSDK.framework (as requested in https://developer.squareup.com/docs/in-app-payments-sdk/installation#option-3-install-the-in-app-payments-sdk-manually)
- libRNSquareInApppayments.a (part of linking)
Comment to @MuhammadNuman answer below:
I tried your podfile in a new react-native project (created by react-init). When I add
import { SQIPCore } from 'react-native-square-in-app-payments';
I get the error described in https://github.com/square/in-app-payments-react-native-plugin/issues/66#issuecomment-629762613
You may find my repo in https://github.com/rahamin1/square_with-podfile