有个flutter项目,其他系统已经发布了,最新在发布iOS版本。在iOS版本运行的过程中报错。

报错信息

 flutter run
Downloading ios tools...                                            6.2s
Downloading ios-profile tools...                                    8.6s
Downloading ios-release tools...                                   15.0s
Launching lib/main.dart on iPhone 17 Pro in debug mode...
Running pod install...                                             282ms
CocoaPods' output:
↳
      Preparing

    Analyzing dependencies

    Inspecting targets to integrate
      Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
      Using `ARCHS` setting to build architectures of target `Pods-RunnerTests`: (``)

    Fetching external sources
    -> Fetching podspec for `Flutter` from `Flutter`
    -> Fetching podspec for `map_launcher` from `.symlinks/plugins/map_launcher/ios`
    -> Fetching podspec for `mobile_scanner` from `.symlinks/plugins/mobile_scanner/darwin`
    -> Fetching podspec for `package_info_plus` from `.symlinks/plugins/package_info_plus/ios`
    -> Fetching podspec for `path_provider_foundation` from `.symlinks/plugins/path_provider_foundation/darwin`
    -> Fetching podspec for `permission_handler_apple` from `.symlinks/plugins/permission_handler_apple/ios`
    -> Fetching podspec for `shared_preferences_foundation` from `.symlinks/plugins/shared_preferences_foundation/darwin`
    -> Fetching podspec for `url_launcher_ios` from `.symlinks/plugins/url_launcher_ios/ios`

    Resolving dependencies of `Podfile`
      CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo
      update
    [!] CocoaPods could not find compatible versions for pod "map_launcher":
      In Podfile:
        map_launcher (from `.symlinks/plugins/map_launcher/ios`)

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

    /opt/homebrew/lib/ruby/gems/4.0.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:317:in
    'Molinillo::Resolver::Resolution#raise_error_unless_state'
    /opt/homebrew/lib/ruby/gems/4.0.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:299:in 'block in
    Molinillo::Resolver::Resolution#unwind_for_conflict'
    /opt/homebrew/lib/ruby/gems/4.0.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:297:in 'Kernel#tap'
    /opt/homebrew/lib/ruby/gems/4.0.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:297:in
    'Molinillo::Resolver::Resolution#unwind_for_conflict'
    /opt/homebrew/lib/ruby/gems/4.0.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:682:in
    'Molinillo::Resolver::Resolution#attempt_to_activate'
    /opt/homebrew/lib/ruby/gems/4.0.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:254:in
    'Molinillo::Resolver::Resolution#process_topmost_state'
    /opt/homebrew/lib/ruby/gems/4.0.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:182:in
    'Molinillo::Resolver::Resolution#resolve'
    /opt/homebrew/lib/ruby/gems/4.0.0/gems/molinillo-0.8.0/lib/molinillo/resolver.rb:43:in 'Molinillo::Resolver#resolve'
    /opt/homebrew/lib/ruby/gems/4.0.0/gems/cocoapods-1.16.2/lib/cocoapods/resolver.rb:94:in 'Pod::Resolver#resolve'
    /opt/homebrew/lib/ruby/gems/4.0.0/gems/cocoapods-1.16.2/lib/cocoapods/installer/analyzer.rb:1082:in 'block in
    Pod::Installer::Analyzer#resolve_dependencies'
    /opt/homebrew/lib/ruby/gems/4.0.0/gems/cocoapods-1.16.2/lib/cocoapods/user_interface.rb:64:in
    'Pod::UserInterface.section'
    /opt/homebrew/lib/ruby/gems/4.0.0/gems/cocoapods-1.16.2/lib/cocoapods/installer/analyzer.rb:1080:in
    'Pod::Installer::Analyzer#resolve_dependencies'
    /opt/homebrew/lib/ruby/gems/4.0.0/gems/cocoapods-1.16.2/lib/cocoapods/installer/analyzer.rb:125:in
    'Pod::Installer::Analyzer#analyze'
    /opt/homebrew/lib/ruby/gems/4.0.0/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:422:in 'Pod::Installer#analyze'
    /opt/homebrew/lib/ruby/gems/4.0.0/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:244:in 'block in
    Pod::Installer#resolve_dependencies'
    /opt/homebrew/lib/ruby/gems/4.0.0/gems/cocoapods-1.16.2/lib/cocoapods/user_interface.rb:64:in
    'Pod::UserInterface.section'
    /opt/homebrew/lib/ruby/gems/4.0.0/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:243:in
    'Pod::Installer#resolve_dependencies'
    /opt/homebrew/lib/ruby/gems/4.0.0/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:162:in 'Pod::Installer#install!'
    /opt/homebrew/lib/ruby/gems/4.0.0/gems/cocoapods-1.16.2/lib/cocoapods/command/install.rb:52:in
    'Pod::Command::Install#run'
    /opt/homebrew/lib/ruby/gems/4.0.0/gems/claide-1.1.0/lib/claide/command.rb:334:in 'CLAide::Command.run'
    /opt/homebrew/lib/ruby/gems/4.0.0/gems/cocoapods-1.16.2/lib/cocoapods/command.rb:52:in 'Pod::Command.run'
    /opt/homebrew/lib/ruby/gems/4.0.0/gems/cocoapods-1.16.2/bin/pod:55:in '<top (required)>'
    /opt/homebrew/Cellar/ruby/4.0.1/lib/ruby/4.0.0/rubygems.rb:303:in 'Kernel#load'
    /opt/homebrew/Cellar/ruby/4.0.1/lib/ruby/4.0.0/rubygems.rb:303:in 'Gem.activate_and_load_bin_path'
    /opt/homebrew/lib/ruby/gems/4.0.0/bin/pod:25:in '<main>'

Error output from CocoaPods:
↳

    [!] Automatically assigning platform `iOS` with version `12.0` on target `Runner` 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 plugin "map_launcher" requires a higher minimum iOS deployment version than your application is targeting.
To build, increase your application's deployment target to at least 13.0 as described at https://flutter.dev/to/ios-deploy
Error running pod install
Error launching application on iPhone 17 Pro.

解决办法

  1. 修改 Podfile 文件
    这是解决问题的关键。

打开项目中的 ios/Podfile 文件。

在文件的最顶部,你会看到类似 # platform :ios, '12.0' 的代码。

去掉前面的井号(#)取消注释,并将版本号改为 13.0。

platform :ios, '13.0'

保存文件。再次运行就不会报错了。

Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐