了解更多信息
总结问题
问题是:
错误如下
Module 'SquareInAppPaymentsSDK' not found
我的播客文件:
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
我的 project.pbxproj 文件(此处无法附加,但您可以在 github 中访问):
https://github.com/square/in-app-payments-react-native-plugin/issues/66#issuecomment-625333601
更新:链接(在第一条评论和@DenisTsoi 回答之后)下面
我尝试了自动链接(如上所述,我需要它,因为我使用的是 RN 0.59.9),然后我再次开始并尝试手动链接,因为我都有同样的错误。您可以在 https://github.com/square/in-app-payments-react-native-plugin/issues/66#issuecomment-625330210 中查看我对此的评论。
顺便说一句,在“将二进制文件与库链接”下,我有两个包条目:
在下面对@MuhammadNuman 的回答发表评论:
我在一个新的 react-native 项目(由 react-init 创建)中尝试了你的 podfile。当我添加
import { SQIPCore } from 'react-native-square-in-app-payments';
我收到 https://github.com/square/in-app-payments-react-native-plugin/issues/66#issuecomment-629762613 中描述的错误
你可以在 https://github.com/rahamin1/square_with-podfile 中找到我的 repo
最佳答案
我过去曾遇到过这种类型的错误。因为一些配置的东西丢失或损坏导致这些类型的问题。所以我给你的建议是创建一个新的 react-native 项目,从那里库的 NPM 或 GitHub 文档中一一安装 package.json 中的所有库。然后将代码从 src (React Code) 复制到新项目中。如果您在 ios 和 android 文件夹中有任何更改,则只需从文件中复制更改并粘贴到新项目 android/ios 文件夹的文件中。 (如果没有任何效果,那么应用这个解决方案。它总是对我有用)
关于xcode - React-native/iOS 应用程序 : Module 'SquareInAppPaymentsSDK' not found, 虽然它已添加到项目中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61664567/