在`../node_modules/react-native-view-pdf`中找不到`RNPDF`的podspec
Posted
技术标签:
【中文标题】在`../node_modules/react-native-view-pdf`中找不到`RNPDF`的podspec【英文标题】:No podspec found for `RNPDF` in `../node_modules/react-native-view-pdf` 【发布时间】:2020-04-22 09:24:17 【问题描述】:我正在为 React Native 应用程序创建 Azure 构建管道,并且在使用 cocoapod 任务安装 pod 时:
- task: CocoaPods@0
inputs:
forceRepoUpdate: true
projectDirectory: '$(system.defaultWorkingDirectory)/ios'
displayName: 'pod install using the CocoaPods'
我在运行管道时收到此错误:
/usr/local/lib/ruby/gems/2.6.0/bin/pod --version
1.9.1
/usr/local/lib/ruby/gems/2.6.0/bin/pod install --repo-update --project-directory=/Users/runner/runners/2.166.2/work/1/s/ios
Updating local specs repositories
Adding spec repo `trunk` with CDN `https://cdn.cocoapods.org/`
Analyzing dependencies
[!] No podspec found for `RNPDF` in `../node_modules/react-native-view-pdf`
[!] Automatically assigning platform `iOS` with version `9.0` on target `abcd` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
##[error]The process '/usr/local/lib/ruby/gems/2.6.0/bin/pod' failed with exit code 1
##[error]The 'pod' command failed with error: The process '/usr/local/lib/ruby/gems/2.6.0/bin/pod' failed with exit code 1
我无法找到此错误的原因,因此需要一些帮助。 我的 podfile 是这样的:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'abcd' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for abcd
pod 'Firebase/Core'
pod 'Firebase/Messaging'
pod 'react-native-webview', :path => '../node_modules/react-native-webview'
pod 'RNPDF', :path => '../node_modules/react-native-view-pdf'
pod 'rn-fetch-blob', :path => '../node_modules/rn-fetch-blob'
pod 'react-native-pdf', :path => '../node_modules/react-native-pdf'
target 'abcdTests' do
inherit! :search_paths
# Pods for testing
end
end
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
end
end
如果您需要任何其他详细信息,请在 cmets 中告诉我。
【问题讨论】:
评论不用于扩展讨论;这个对话是moved to chat。 【参考方案1】:我没有找到答案,但我有一个解决方法, 我只是删除了两行:
pod 'RNPDF', :path => '../node_modules/react-native-view-pdf'
pod 'react-native-webview', :path => '../node_modules/react-native-webview'
来自 podfile,之前是这样的:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'SiteFuelBuyer' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for SiteFuelBuyer
pod 'Firebase/Core'
pod 'Firebase/Messaging'
pod 'RNPDF', :path => '../node_modules/react-native-view-pdf'
pod 'react-native-webview', :path => '../node_modules/react-native-webview'
pod 'rn-fetch-blob', :path => '../node_modules/rn-fetch-blob'
pod 'react-native-pdf', :path => '../node_modules/react-native-pdf'
target 'SiteFuelBuyerTests' do
inherit! :search_paths
# Pods for testing
end
end
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
end
end
现在,
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'SiteFuelBuyer' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for SiteFuelBuyer
pod 'Firebase/Core'
pod 'Firebase/Messaging'
pod 'rn-fetch-blob', :path => '../node_modules/rn-fetch-blob'
pod 'react-native-pdf', :path => '../node_modules/react-native-pdf'
target 'SiteFuelBuyerTests' do
inherit! :search_paths
# Pods for testing
end
end
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
end
end
总是欢迎其他更好的答案。
【讨论】:
以上是关于在`../node_modules/react-native-view-pdf`中找不到`RNPDF`的podspec的主要内容,如果未能解决你的问题,请参考以下文章
NOIP 2015 & SDOI 2016 Round1 & CTSC 2016 & SDOI2016 Round2游记