本文介绍了在iOS中运行颤动应用程序时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Launching lib/main.dart on iPhone 12 Pro Max in debug mode...
正在运行Pod安装.CocoaPods的输出:↳CDN:中继相对路径:cocoaPods-version.yml存在!返回本地,因为检查仅在回购更新中执行

CocoaPods的错误输出:↳警告:CocoaPods要求您的终端使用UTF-8编码。考虑将以下内容添加到~/.profile:

    export LANG=en_US.UTF-8
    
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/unicode_normalize/normalize.rb:141:in `normalize': Unicode Normalization not appropriate for ASCII-8BIT (Encoding::CompatibilityError)
    from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/lib/cocoapods/config.rb:166:in `unicode_normalize'
    from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/lib/cocoapods/config.rb:166:in `installation_root'
    from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/lib/cocoapods/config.rb:226:in `podfile_path'
    from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/lib/cocoapods/user_interface/error_report.rb:105:in `markdown_podfile'
    from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/lib/cocoapods/user_interface/error_report.rb:30:in `report'
    from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/lib/cocoapods/command.rb:66:in `report_error'
    from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:396:in `handle_exception'
    from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:337:in `rescue in run'
    from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:324:in `run'
    from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/lib/cocoapods/command.rb:52:in `run'
    from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/bin/pod:55:in `<top (required)>'
    from /usr/local/bin/pod:23:in `load'
    from /usr/local/bin/pod:23:in `<main>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/unicode_normalize/normalize.rb:141:in `normalize': Unicode Normalization not appropriate for ASCII-8BIT (Encoding::CompatibilityError)
    from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/lib/cocoapods/config.rb:166:in `unicode_normalize'
    from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/lib/cocoapods/config.rb:166:in `installation_root'
    from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/lib/cocoapods/config.rb:226:in `podfile_path'
    from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/lib/cocoapods/config.rb:205:in `podfile'
    from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/lib/cocoapods/command.rb:160:in `verify_podfile_exists!'
    from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/lib/cocoapods/command/install.rb:46:in `run'
    from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
    from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/lib/cocoapods/command.rb:52:in `run'
    from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0/bin/pod:55:in `<top (required)>'
    from /usr/local/bin/pod:23:in `load'
    from /usr/local/bin/pod:23:in `<main>'
运行Pod安装时出错在iPhone 12 Pro Max上启动应用程序时出错。

推荐答案

似乎是CocoaPods v1.11.0中的一种错误/不可兼容性问题

为了解决该问题,我按照以下步骤操作,它非常有效:https://stackoverflow.com/a/69076515/16881741

简单地说,请执行以下步骤:

  1. 在您的终端中,在iOS文件夹中键入

    gem list --local | grep cocoapods

  2. 记下上一个命令的输出。看起来是这样的(请忽略各个条目附近的版本,这是我的输出,我已经在使用版本1.10.1):

cocoapods (1.10.1)cocoapods-core (1.10.1)cocoapods-deintegrate (1.0.5)cocoapods-downloader (1.5.1)cocoapods-plugins (1.0.0)cocoapods-search (1.0.1)cocoapods-trunk (1.6.0)cocoapods-try (1.2.0)

  1. 逐个启动命令sudo gem uninstall X将";X";替换为CocoaPods组件的名称,不带版本。最后,您应该获得以下内容:

sudo gem uninstall cocoapodssudo gem uninstall cocoapods-coresudo gem uninstall cocoapods-deintegratesudo gem uninstall cocoapods-downloadersudo gem uninstall cocoapods-pluginssudo gem uninstall cocoapods-searchsudo gem uninstall cocoapods-trunksudo gem uninstall cocoapods-try

确保已包括点N.1中列出的所有组件,以避免出现脏状态

  1. 使用命令sudo gem install cocoapods -v 1.10.1若要获取正确版本,请执行以下操作。

所有荣誉归功于埃斯特班·洛佩兹(Esteban Lopez),他是我在顶部链接的答案的作者。

这篇关于在iOS中运行颤动应用程序时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 05:23