我们正在尝试创建一个在本机应用程序中使用的 Pod。 pod 文件将成为我们 SDK 的入口点。该 SDK(pod)正在使用react-native。基本上,打开一个新屏幕,其中包含(第三方)本机 ios 应用程序中的内容。
我们的问题是
s.dependency 'React'
。
require 'json'
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
Pod::Spec.new do |s|
s.name = "AwesomeSdk"
s.version = "0.0.1"
s.summary = "Payment SDK"
s.description = "Payment SDK from Wallee AG"
s.homepage = "https://en.awesome.com"
s.license = { :type => "MIT", :file => "LICENSE.md" }
s.author = { "Awesome Awesome" => "[email protected]" }
s.platform = :ios, "9.0"
s.source = { :git => "https://gitlab.com/awesomesdk/frontend/mobile-sdk-android.git", :branch => "WAL-78109-ios", :tag => "0.0.1" }
s.source_files = "ios/sdk/AwesomeSdk/**/*.{h,m,swift}"
s.swift_version = "5.0"
s.dependency 'React'
end
我们能够将我们的 pod 连接到存储库之外的另一个应用程序,但是当我们想要安装 pod 时
pod install
它将开始安装 React 0.11.0
Analyzing dependencies
Downloading dependencies
Installing React (0.11.0)
此后是卡拉什并出现 verri logn 错误:
[!] /bin/bash -c
set -e
npm install --production
npm WARN config production Use `--omit=dev` instead.
npm ERR! code 1
npm ERR! git dep preparation failed
npm ERR! command /Users/mynam/.nvm/versions/node/v16.15.1/bin/node /Users/mynam/.nvm/versions/node/v16.15.1/lib/node_modules/npm/bin/npm-cli.js install --force --cache=/Users/mynam/.npm --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-run
npm ERR! npm WARN using --force Recommended protections disabled.
...
npm ERR! npm ERR! /Users/mynam/Library/Caches/node-gyp/16.15.1/include/node/v8.h:11785:15: note: candidate constructor not viable: requires at least 3 arguments, but 1 was provided
npm ERR! npm ERR! ScriptOrigin::ScriptOrigin(
npm ERR! npm ERR! ^
npm ERR! npm ERR! /Users/mynam/Library/Caches/node-gyp/16.15.1/include/node/v8.h:11816:15: note: candidate constructor not viable: requires at least 2 arguments, but 1 was provided
npm ERR! npm ERR! ScriptOrigin::ScriptOrigin(Isolate* isolate, Local<Value> resource_name,
npm ERR! npm ERR! ^
npm ERR! npm ERR! ../src/contextify.cc:126:45: error: too few arguments to function call, single argument 'context' was not specified
npm ERR! npm ERR! constructor.Reset(tmpl->GetFunction());
npm ERR! npm ERR!
...
版本错误,我们需要 RN 0.69,但当我指定它时
s.dependency 'React', '~> 0.69.0'
找不到这个模块
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "React":
In Podfile:
AwesomeSdk (from `../mobile-sdk-android`) was resolved to 0.0.1, which depends on
React (~> 0.69.0)
我们需要在 pod 文件中添加 React 依赖...有什么提示吗?
我正在尝试通过 podspec 嵌入 React Native 应用程序,但 React 依赖项导致了与您相同的问题。您找到解决这个问题的方法了吗?