flutter之CocoaPods could not find
2021-01-21 本文已影响0人
loongod
运行 flutter build ios
的时候报错Error running pod install
,中间的报错信息如下:
[!] CocoaPods could not find compatible versions for
pod "xxPlugin":
In Podfile:
FlutterPluginRegistrant (from
`Flutter/FlutterPluginRegistrant`) was resolved to
0.0.1, which depends on
xxPlugin
xxPlugin (from
`Flutter/.symlinks/xxPlugin/ios`)
因为 flutter build ios
的时候会运行 pod install
命令,而 ios
(或者.ios
)下的 PodFile
文件如下
platform :ios, '8.0'
flutter_application_path = '../'
load File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')
use_frameworks!
target 'Runner' do
install_flutter_engine_pod
install_flutter_plugin_pods flutter_application_path
end
会根据 path : ios/Flutter/FlutterPluginRegistrant/
本地引用FlutterPluginRegistrant
。
而 FlutterPluginRegistrant.podspec
内会引用所有的 plugin
(有ios
和android
代码)
#
# Generated file, do not edit.
#
Pod::Spec.new do |s|
s.name = 'FlutterPluginRegistrant'
s.version = '0.0.1'
s.summary = 'Registers plugins with your flutter app'
s.description = <<-DESC
Depends on all your plugins, and provides a function to register them.
DESC
s.homepage = 'https://flutter.dev'
s.license = { :type => 'BSD' }
s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' }
s.ios.deployment_target = '8.0'
s.source_files = "Classes", "Classes/**/*.{h,m}"
s.source = { :path => '.' }
s.public_header_files = './Classes/**/*.h'
s.static_framework = true
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
s.dependency 'Flutter'
s.dependency 'bridgePlugin'
s.dependency 'flutter_boost'
end
查看下所有的 plugin
的 podspec
中指定的 ios
版本要求,是否高于 ios
文件夹下 PodFile
的版本,如果高于,修改即可。