Home > other >  flutter Simulator doesn't work on android studio but works through Xcode
flutter Simulator doesn't work on android studio but works through Xcode

Time:12-11

its a strange issue, when I build and run app on simulator via android studio, I get the following error:

Launching lib/main.dart on iPhone SE (2nd generation) in debug mode... Upgrading AppFrameworkInfo.plist 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
        
    /Users/riyazatalidurrani/.rvm/rubies/ruby-2.6.6/lib/ruby/2.6.0/unicode_normalize/normalize.rb:141:in `normalize': Unicode Normalization not appropriate for ASCII-8BIT (Encoding::CompatibilityError)
        from /Users/riyazatalidurrani/.rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/config.rb:166:in `unicode_normalize'
        from /Users/riyazatalidurrani/.rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/config.rb:166:in `installation_root'
        from /Users/riyazatalidurrani/.rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/config.rb:226:in `podfile_path'
        from /Users/riyazatalidurrani/.rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/user_interface/error_report.rb:105:in `markdown_podfile'
        from /Users/riyazatalidurrani/.rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/user_interface/error_report.rb:30:in `report'
        from /Users/riyazatalidurrani/.rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:66:in `report_error'
        from /Users/riyazatalidurrani/.rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:396:in `handle_exception'
        from /Users/riyazatalidurrani/.rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:337:in `rescue in run'
        from /Users/riyazatalidurrani/.rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:324:in `run'
        from /Users/riyazatalidurrani/.rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:52:in `run'
        from /Users/riyazatalidurrani/.rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/cocoapods-1.11.2/bin/pod:55:in `<top (required)>'
        from /Users/riyazatalidurrani/.rvm/rubies/ruby-2.6.6/bin/pod:23:in `load'
        from /Users/riyazatalidurrani/.rvm/rubies/ruby-2.6.6/bin/pod:23:in `<main>'
        from /Users/riyazatalidurrani/.rvm/gems/ruby-2.6.6/bin/ruby_executable_hooks:22:in `eval'
        from /Users/riyazatalidurrani/.rvm/gems/ruby-2.6.6/bin/ruby_executable_hooks:22:in `<main>'
    /Users/riyazatalidurrani/.rvm/rubies/ruby-2.6.6/lib/ruby/2.6.0/unicode_normalize/normalize.rb:141:in `normalize': Unicode Normalization not appropriate for ASCII-8BIT (Encoding::CompatibilityError)
        from /Users/riyazatalidurrani/.rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/config.rb:166:in `unicode_normalize'
        from /Users/riyazatalidurrani/.rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/config.rb:166:in `installation_root'
        from /Users/riyazatalidurrani/.rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/config.rb:226:in `podfile_path'
        from /Users/riyazatalidurrani/.rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/config.rb:205:in `podfile'
        from /Users/riyazatalidurrani/.rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:160:in `verify_podfile_exists!'
        from /Users/riyazatalidurrani/.rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command/install.rb:46:in `run'
        from /Users/riyazatalidurrani/.rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
        from /Users/riyazatalidurrani/.rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:52:in `run'
        from /Users/riyazatalidurrani/.rvm/rubies/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/cocoapods-1.11.2/bin/pod:55:in `<top (required)>'
        from /Users/riyazatalidurrani/.rvm/rubies/ruby-2.6.6/bin/pod:23:in `load'
        from /Users/riyazatalidurrani/.rvm/rubies/ruby-2.6.6/bin/pod:23:in `<main>'
        from /Users/riyazatalidurrani/.rvm/gems/ruby-2.6.6/bin/ruby_executable_hooks:22:in `eval'
        from /Users/riyazatalidurrani/.rvm/gems/ruby-2.6.6/bin/ruby_executable_hooks:22:in `<main>'

Error running pod install
Error launching application on iPhone SE (2nd generation).

but when I build from Xcode, it builds perfectly.

CodePudding user response:

i got a brief solution to my question. after running the following commands one by one:

flutter clean
rm -Rf ios/Pods
rm -Rf ios/.symlinks
rm -Rf ios/Flutter/Flutter.framework
rm -Rf ios/Flutter/Flutter.podspec
flutter pub get
cd ios
pod install
arch -x86_64 pod install (On an M1 mac use => arch -x86_64 pod install)

here if you get UTF-8 error then run this command

export LC_ALL=en_US.UTF-8

and run arch -x86_64 pod install (On an M1 mac use => arch -x86_64 pod install) command again.

finally run flutter run command to start the simulator

  • Related