Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting error while run flutter app in iOS

Launching lib/main.dart on iPhone 12 Pro Max in debug mode...

Running pod install... CocoaPods' output: ↳ CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update

Error output from CocoaPods: ↳ WARNING: CocoaPods requires your terminal to be using UTF-8 encoding. Consider adding the following to ~/.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>'

Error running pod install Error launching application on iPhone 12 Pro Max.

enter image description here

enter image description here

like image 346
rvndsngwn Avatar asked Sep 06 '21 07:09

rvndsngwn


People also ask

How do I run a Flutter app on iOS?

To test or deploy our flutter app to a physical device we first need to enable physical device deployment in Xcode using Apple ID or an Apple Developer account. And we also need to set up a package manager to manage flutter plugins that are to be used in the project.

Is Flutter stable for iOS?

We have all of the six major platforms – iOS, Android, web, Windows, macOS, Linux – all supported as stable parts of the Flutter framework."

Does Flutter apps work on iOS?

Flutter supports iOS 9.0 and later. If your app or plugins include Objective-C or Swift code that makes use of APIs newer than iOS 9, update this setting to the highest required version.

Do I need Xcode to run Flutter?

Flutter is a multi-platform application development framework that enables you, among other platforms, to develop iOS and Android apps from the same source code. However, you need to use Xcode to build an iOS app and Xcode will only work on macOS. You cannot get away with Linux or Windows.


Video Answer


2 Answers

It seems that is a sort of bug/incombatibility issue in Cocoapods v 1.11.0

To fix the issue, I followed these steps and it worked like a charm: https://stackoverflow.com/a/69076515/16881741

Briefly, follow these steps:

  1. In your terminal, in ios folder type

    gem list --local | grep cocoapods

  2. Take note of what is the output of the previous command. It looks like that (please ignore the version near the various entry, this is my output and I already use the version 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. One by one, launch the command sudo gem uninstall X substituting the "X" with the name of the cocoapods component, without the version. At the end you should obtain this:

sudo gem uninstall cocoapods sudo gem uninstall cocoapods-core sudo gem uninstall cocoapods-deintegrate sudo gem uninstall cocoapods-downloader sudo gem uninstall cocoapods-plugins sudo gem uninstall cocoapods-search sudo gem uninstall cocoapods-trunk sudo gem uninstall cocoapods-try

Be sure to have included all the component listed in the point n.1 to avoid dirty status

  1. Use the command sudo gem install cocoapods -v 1.10.1 To obtain the correct version.

All kudos to Esteban Lopez, the author of the answer I linked at the top.

like image 77
Picchio Avatar answered Oct 24 '22 06:10

Picchio


This issues appeared in Cocoapods 1.11.0 and as many already noticed rolling back to 1.10.2 fixes the issue. But the original issue comes from wrong locale set in the terminal. It has to be a UTF-8-based locale.

The second answer in here solved the issue for me.

As stated, just run

export LC_ALL=en_US.UTF-8

in your terminal, and the error should go away. Consider adding this to your .zshrc file so that it happens automatically in every session.

like image 40
Sameeran Bandishti Avatar answered Oct 24 '22 06:10

Sameeran Bandishti