Flutter setup memo (macOS)


環境

  • M1 MacBook Pro
  • macOS Big Sur 11.2.3
  • Flutter 2.0.4
  • Xcode 12.4
  • Android Studio 4.1

問題

  • flutter doctor -v で Permission 系エラー
    sudo 付けるとイケるが
Woah! You appear to be trying to run flutter as root.

うわー! と言われる。

  • doctor で CocoaPods 入れ直せと言われるが、
CocoaPods installed but not working.
You appear to have CocoaPods installed but it is not working.
This can happen if the version of Ruby that CocoaPods was installed with is different from the one being used to invoke it.
This can usually be fixed by re-installing CocoaPods.
To re-install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.

pod の設定周りは問題なし、何度試しても同じ。

解決

Why is Flutter only running as Superuser?
で色々協議されているが、
私の場合、
/Users/yourUser/.config

/Users/yourUser/.flutter
chownすると、上記2点の問題は解決した。

おまけ

M1 Mac で Android Studio の エミュレータはまだダメっぽい。なんか面倒臭そう。。

Unable to install Intel® HAXM
Your CPU does not support VT-x.
Unfortunately, your computer does not support hardware accelerated virtualization.
Here are some of your options:
 1) Use a physical device for testing
 2) Develop on a Windows/OSX computer with an Intel processor that supports VT-x and NX
 3) Develop on a Linux computer that supports VT-x or SVM
 4) Use an Android Virtual Device based on an ARM system image
   (This is 10x slower than hardware accelerated virtualization