Getting error while run flutter app in iOS
Asked Answered
B

7

10
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

Benighted answered 6/9, 2021 at 7:14 Comment(4)
you can check my answer for resolve yours => https://mcmap.net/q/219525/-flutter-app-is-not-running-by-flutter-build-ios-but-runs-by-xcodeArthurarthurian
Thanks @TusharPatel sir, but I'm getting same error on pod install?Benighted
hey did you find the solution i am also facing same errorNorry
This worked for me: flutter clean, delete /iOS/Pods, delete /iOS/Podfile.lock, flutter build ios.Benighted
C
16

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://mcmap.net/q/218581/-unicode-normalization-not-appropriate-for-ascii-8bit

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.

Cheddar answered 10/9, 2021 at 20:28 Comment(5)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Bowdlerize
Thank you for helping, I'm already using version 1.11.0, CocoaPods : 1.11.0 Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin20] RubyGems : 3.0.3 Host : macOS 11.5.2 (20G95) Xcode : 12.5.1 (12E507) Git : git version 2.23.0 Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib Repositories : trunk - CDN - cdn.cocoapods.orgBenighted
Please downgrade from 1.11.0 and use version 1.10.1Cheddar
Thank you so much, this answer worked for mePrajna
Working like charm. Thanks. please update answer with 'sudo gem install cocoapods -v 1.10.2'Caprine
N
16

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.

Navarre answered 30/11, 2021 at 17:33 Comment(1)
This one solved my problemFreestyle
C
2

open terminal export LC_ALL=en_US.UTF-8 this will solve your issue.

Craniate answered 19/4, 2023 at 19:49 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Bowdlerize
B
1

Try pod install with default terminal.

Benighted answered 31/3, 2022 at 5:54 Comment(1)
This was exactly what worked for me.Blimey
B
0

This worked for me:

flutter clean,
delete /iOS/Pods,
delete /iOS/Podfile.lock,
flutter build ios.

my Mac version info:

   CocoaPods : 1.11.0
        Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin20]
    RubyGems : 3.0.3
        Host : macOS 11.5.2 (20G95)
       Xcode : 12.5.1 (12E507)
         Git : git version 2.23.0
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
Repositories : trunk - CDN - https://cdn.cocoapods.org/
Benighted answered 13/9, 2021 at 2:12 Comment(1)
NOTE: In all M1 machines, Android Studio & IntelliJ Idea terminal does not compile the pod install command yet. but all other terminals do it. I don't know the why. This is my observation.Benighted
P
0

Ran the same project on VCode and it worked successfully, guess the issue was with my Android Studio.

Prajna answered 1/11, 2021 at 20:22 Comment(1)
In all M1 machines, Android Studio & IntelliJ Idea terminal does not compile the pod install command yet. but all other terminals do it. I don't know the why. This is my observation.Benighted
U
-1

Upgrade Ruby is another way to resolve this issue.

Uranous answered 7/2, 2022 at 6:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.