flutterxcode13macos-montereyflutter-doctorrosetta-2

Flutter Doctor gives Bad Cpu Type in executable


I'm using Mac mini , MacOs monterey and m1 chip. When trying to setup flutter, it is giving error. command: flutter doctor o/p: /Users/admin/Desktop/flutter/bin/internal/shared.sh: line 229: /Users/admin/Desktop/flutter/bin/cache/dart-sdk/bin/dart: Bad CPU type in executable

I have tried below command but it is also not working, Terminal command: sudo softwareupdate --install-rosetta --agree-to-license Terminal output: By using the agreetolicense option, you are agreeing that you have run this tool with the license only option and have read and agreed to the terms. If you do not agree, press CTRL-C and cancel this process immediately. Rosetta 2 update is not available


Solution

  • My mistake was that , I had installed flutter sdk before installing the Rosetta. So that's why it was giving the above error. So, to resolve this, I removed the flutter sdk and installed rosetta first then again installed flutter and it worked properly.