Flutter引用第三方库时报Automatically assigning platform `ios` with version `8.0` on target `Runner`

Automatically assigning platform `ios` with version `8.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile

在mac上使用Android studio运行项目时出现如上错误,是由于Flutter引用第三方库esys_flutter_share和qr_code_tools时未指定版本。

解决办法:

修改项目里的ios/Podfile文件,

# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
platform :ios, '8.0' #增加的内容

之后又遇到如下问题

flutter Unable to determine Swift version for the following pods

是指定的SWIFT版本问题,但xcode的tagets中没有指定SWIFT_VERSION版本这一项,点buildSettings中的+号,添加SWIFT_VERSION,指定版本号4.2,再执行pod update --verbose --no-repo-update解决问题

修改项目里的ios/Podfile文件,

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['SWIFT_VERSION'] = '4.2'  #增加修改内容
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end

之后又遇到如下问题

flutter 'qr_code_tools/qr_code_tools-Swift.h' file not found

又是修改项目里的ios/Podfile文件,

target 'Runner' do
  # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
  # referring to absolute paths on developers' machines.
  use_frameworks! # required by qr_code_tools #增加修改的内容
  system('rm -rf .symlinks')
  system('mkdir -p .symlinks/plugins')
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值