Error when trying to run my Flutter App with my m1 mac
Asked Answered
M

2

2

I get the following Error everytime i try to run my Flutter App. I tried literally so much to fix it but still the Error isn't fixed.

Launching lib/main.dart on iPhone 12 Pro Max in debug mode... Running pod install... CocoaPods' output: ↳ Preparing

Analyzing dependencies

Inspecting targets to integrate
[!] Unable to find a target named `testing_gowtham` in project `Runner.xcodeproj`, did find `Runner`.

/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer/target_inspector.rb:108:in `compute_targets'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer/target_inspector.rb:40:in `compute_results'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1189:in `block (3 levels) in inspect_targets_to_integrate'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1187:in `each'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1187:in `block (2 levels) in inspect_targets_to_integrate'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1185:in `each'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1185:in `block in inspect_targets_to_integrate'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1180:in `inspect_targets_to_integrate'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:106:in `analyze'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:414:in `analyze'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:239:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:238:in `resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:160:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command/install.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'

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

Matland answered 28/6, 2021 at 19:11 Comment(0)
I
14

Try this :

Cocoa Pods Installation in M1

  • sudo gem install cocoapods
  • sudo gem install ffi
  • arch -x86_64 sudo gem install cocoapods -n /usr/local/bin
  • sudo gem install cocoapods -n /usr/local/bin

Install ffi

  • sudo arch -x86_64 gem install ffi

#update repo

  • arch -x86_64 pod install --repo-update

Flutter iOS builds

  • flutter clean
  • flutter build ios

Re-install dependency in iOS folder of flutter project

  • arch -x86_64 pod install
Ivetteivetts answered 28/6, 2021 at 22:4 Comment(1)
I've done all of this now i run into following error Message: /GeneratedPluginRegistrant.m:10:9: fatal error: module 'audioplayers' not found @import audioplayers; ~~^~~~~ 1 error generated. note: Using new build system note: Building targets in parallel note: Planning build note: Analyzing workspace note: Constructing build description note: Build preparation complete Could not build the application for the simulator.Matland
L
1

Please follow this article to install the coca-pods. I also follow this article when I setup the flutter on my Macbook M1.

-> make sure you have enabled the rosetta in your terminal (discussed in the following article)

https://medium.com/codex/simple-way-to-use-cocoapods-on-m1-ac9e22cf7e1c

Latinity answered 29/6, 2021 at 4:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.