如何解决 Flutter 应用上 iOS 部分的问题?

问题描述

我正在处理 Flutter 应用程序和 ios 部分工作没有问题,但我将 Flutter 更新到版本 1.22.5,当我尝试启动应用程序时 Flutter make pod install显示以下消息:

Analyzing dependencies
firebase_core: Using Firebase SDK version '6.33.0' defined in 'firebase_core'
Downloading dependencies
Installing FMDB (2.7.5)
Installing FXBlurView (1.6.4)
Installing Firebase (6.33.0)
Installing FirebaseAnalytics (6.8.3)
Installing FirebaseCore (6.10.3)
Installing FirebaseCoreDiagnostics (1.7.0)
Installing FirebaseInstallations (1.7.0)
Installing FirebaseInstanceID (4.8.0)
Installing FirebaseMessaging (4.7.1)
Installing Flutter (1.0.0)
Installing GoogleAppMeasurement (6.8.3)
Installing GoogleDataTransport (7.5.1)
Installing GoogleMaps (3.9.0)
Installing GoogleUtilities (6.7.2)
Installing JRSwizzle (1.0)
Installing MLBusinessComponents (1.26.0)
Installing MLCardDrawer (1.5.1)
Installing MLCardForm (0.9.1)
Installing MLUI (5.24.0)
Installing MercadoPagoSDK (4.32.4)
Installing PromisesObjC (1.2.11)
Installing Protobuf (3.13.0)
Installing address_search_field (1.0.0)
Installing device_info (0.0.1)
Installing firebase_analytics (0.0.1)
Installing firebase_core (0.5.3)
Installing firebase_messaging (0.0.1)
Installing Flutter_open_whatsapp (0.0.1)
Installing geocoder (0.0.1)
Installing geolocator (5.3.2+2)
Installing google_maps_Flutter (0.0.1)
Installing image_picker (0.0.1)
Installing location (0.0.1)
Installing location_permissions (3.0.0+1)
Installing mercado_pago_mobile_checkout (0.0.1)
Installing nanopb (1.30906.0)
Installing path_provider (0.0.1)
Installing shared_preferences (0.0.1)
Installing sqflite (0.0.2)
Installing url_launcher (0.0.1)
Installing webview_Flutter (0.0.1)

――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

### Command


/usr/local/bin/pod install


### Report

* What did you do?

* What did you expect to happen?

* What happened instead?


### Stack

   CocoaPods : 1.10.1
        Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
    RubyGems : 3.0.3
        Host : Mac OS X 10.15.7 (19H114)
       Xcode : 12.3 (12C33)
         Git : git version 2.24.3 (Apple Git-128)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
Repositories : trunk - CDN - https://cdn.cocoapods.org/


### Plugins


cocoapods-deintegrate : 1.0.4
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.1.0
cocoapods-trunk       : 1.4.1
cocoapods-try         : 1.1.0


### Podfile

ruby
# Uncomment this line to define a global platform for your project
platform :ios,'13.0'

# CocoaPods analytics sends network stats synchronously affecting Flutter build latency.
ENV['COCOAPODS_disABLE_STATS'] = 'true'

project 'Runner',{
  'Debug' => :debug,'Profile' => :release,'Release' => :release,}

def Flutter_root
  generated_xcode_build_settings_path = File.expand_path(File.join('..','Flutter','Generated.xcconfig'),__FILE__)
  unless File.exist?(generated_xcode_build_settings_path)
    raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually,make sure Flutter pub get is executed first"
  end

  File.foreach(generated_xcode_build_settings_path) do |line|
    matches = line.match(/FlutteR_ROOT\=(.*)/)
    return matches[1].strip if matches
  end
  raise "FlutteR_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig,then run Flutter pub get"
end

require File.expand_path(File.join('packages','Flutter_tools','bin','podhelper'),Flutter_root)

Flutter_ios_podfile_setup

target 'Runner' do
  use_frameworks!
  use_modular_headers!

  Flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    Flutter_additional_ios_build_settings(target)
  end
end


### Error


Errno::EIO - Input/output error @ io_fread - /Volumes/INFO/Beux/client_app/ios/Flutter/Flutter.framework/Flutter
/Library/Ruby/Gems/2.6.0/gems/ruby-macho-1.4.0/lib/macho/fat_file.rb:94:in `read'
/Library/Ruby/Gems/2.6.0/gems/ruby-macho-1.4.0/lib/macho/fat_file.rb:94:in `open'
/Library/Ruby/Gems/2.6.0/gems/ruby-macho-1.4.0/lib/macho/fat_file.rb:94:in `initialize'
/Library/Ruby/Gems/2.6.0/gems/ruby-macho-1.4.0/lib/macho.rb:31:in `new'
/Library/Ruby/Gems/2.6.0/gems/ruby-macho-1.4.0/lib/macho.rb:31:in `open'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/xcode/linkage_analyzer.rb:16:in `dynamic_binary?'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/sandBox/file_accessor.rb:171:in `block in vendored_dynamic_frameworks'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/sandBox/file_accessor.rb:170:in `select'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/sandBox/file_accessor.rb:170:in `vendored_dynamic_frameworks'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/sandBox/file_accessor.rb:179:in `vendored_static_frameworks'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/sandBox/file_accessor.rb:292:in `vendored_static_artifacts'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/xcode/target_validator.rb:82:in `each'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/xcode/target_validator.rb:82:in `flat_map'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/xcode/target_validator.rb:82:in `block (2 levels) in verify_no_static_framework_transitive_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/xcode/target_validator.rb:74:in `each_key'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/xcode/target_validator.rb:74:in `block in verify_no_static_framework_transitive_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/xcode/target_validator.rb:73:in `each'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/xcode/target_validator.rb:73:in `verify_no_static_framework_transitive_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/xcode/target_validator.rb:38:in `validate!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:595:in `validate_targets'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:162:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command/install.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'


――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

[!] Oh no,an error occurred.

Search for existing GitHub issues similar to yours:
https://github.com/CocoaPods/CocoaPods/search?q=Input%2Foutput+error+%40+io_fread+-+%2FVolumes%2FINFO%2FBeux%2Fclient_app%2Fios%2FFlutter%2FFlutter.framework%2FFlutter&type=Issues

If none exists,create a ticket,with the template displayed above,on:
https://github.com/CocoaPods/CocoaPods/issues/new

Be sure to first read the contributing guide for details on how to properly submit a ticket:
https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md

Don't forget to anonymize any private data!

Looking for related issues on cocoapods/cocoapods...
Found no similar issues. To create a new issue,please visit:
https://github.com/cocoapods/cocoapods/issues/new

Flutter doctor

Doctor summary (to see all details,run Flutter doctor -v):
[✓] Flutter (Channel stable,1.22.5,on Mac OS X 10.15.7 19H114 darwin-x64,locale en-CO)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
[✓] Android Studio (version 4.0)
[✓] VS Code (version 1.52.1)
[!] Connected device
    ! No devices available

! Doctor found issues in 1 category.

解决方法

    Uninstall and install cocopods using below Commands,- sudo gem uninstall cocoapods
        - sudo gem install cocoapods
        - Restart IDE.
        
   If not working than you have to try with this below commands using for uninstall and install again pods and Run.
       - flutter clean
       - rm -Rf ios/Pods
       - rm -Rf ios/.symlinks
       - rm -Rf ios/Flutter/Flutter.framework
       - rm -Rf ios/Flutter/Flutter.podspec
       - rm ios/Podfile
       - flutter run

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...