關(guān)于運(yùn)行flutter項(xiàng)目集成第三方插件原生也要下載SDK報(bào)Fetching external sources -> Fetching podspec for `Flutter` fro...

關(guān)于運(yùn)行flutter項(xiàng)目集成第三方插件原生也要下載SDK報(bào)Fetching external sources -> Fetching podspec for `Flutter` from `.symlinks/flutter/ios` -> Fetching podspec for `xxx` from `.symlinks/plugins/getuiflut/ios`


[!] CocoaPods could not find compatible versions for pod "Flutter":

? In Podfile:

? ? Flutter (from `.symlinks/flutter/ios`)

Specs satisfying the `Flutter (from `.symlinks/flutter/ios`)` dependency were found, but they required a higher minimum deployment target.

run pod install 提示

找到iOS項(xiàng)目中的podfile文件你可以導(dǎo)入

pre_install do |installer|

? # workaround for https://github.com/CocoaPods/CocoaPods/issues/3289

? Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}

end


也可以直接復(fù)制下面這些直接到podfile文件中

# Uncomment this line to define a global platform for your project

platform :ios, '9.0'

use_frameworks!

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.

ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {

? 'Debug' => :debug,

? 'Profile' => :release,

? 'Release' => :release,

}

def parse_KV_file(file, separator='=')

? file_abs_path = File.expand_path(file)

? if !File.exists? file_abs_path

? ? return [];

? end

? pods_ary = []

? skip_line_start_symbols = ["#", "/"]

? File.foreach(file_abs_path) { |line|

? ? ? next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }

? ? ? plugin = line.split(pattern=separator)

? ? ? if plugin.length == 2

? ? ? ? podname = plugin[0].strip()

? ? ? ? path = plugin[1].strip()

? ? ? ? podpath = File.expand_path("#{path}", file_abs_path)

? ? ? ? pods_ary.push({:name => podname, :path => podpath});

? ? ? else

? ? ? ? puts "Invalid plugin specification: #{line}"

? ? ? end

? }

? return pods_ary

end

pre_install do |installer|

? # workaround for https://github.com/CocoaPods/CocoaPods/issues/3289

? Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}

end

target 'Runner' do

? # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock

? # referring to absolute paths on developers' machines.

? system('rm -rf .symlinks')

? system('mkdir -p .symlinks/plugins')


? # Flutter Pods

? generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')

? if generated_xcode_build_settings.empty?

? ? puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first."

? end

? generated_xcode_build_settings.map { |p|

? ? if p[:name] == 'FLUTTER_FRAMEWORK_DIR'

? ? ? symlink = File.join('.symlinks', 'flutter')

? ? ? File.symlink(File.dirname(p[:path]), symlink)

? ? ? pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))

? ? end

? }

? # Plugin Pods

? plugin_pods = parse_KV_file('../.flutter-plugins')

? plugin_pods.map { |p|

? ? symlink = File.join('.symlinks', 'plugins', p[:name])

? ? File.symlink(p[:path], symlink)

? ? pod p[:name], :path => File.join(symlink, 'ios')

? }

end

post_install do |installer|

? installer.pods_project.targets.each do |target|

? ? target.build_configurations.each do |config|

? ? ? config.build_settings['ENABLE_BITCODE'] = 'NO'

? ? end

? end

end

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容