Open19

Flutter開発 日々のメモ帳

hndrhndr

Xcode再インストール手順

Screen動画撮りたくてXcode 12.5にバージョンを上げたらFlutterアプリが起動しなくなったため、削除してダウングレードした。

Xcodeを全削除 する

sudo rm -rf /Applications/Xcode.app
sudo rm -rf /Library/Preferences/com.apple.dt.Xcode.plist
sudo rm -rf ~/Library/Preferences/com.apple.dt.Xcode.plist
sudo rm -rf ~/Library/Caches/com.apple.dt.Xcode
sudo rm -rf ~/Library/Application Support/Xcode
sudo rm -rf ~/Library/Developer/Xcode
sudo rm -rf ~/Library/Developer/CoreSimulator

More Downloads for Apple DevelopersからXcode12.4を落とす

https://developer.apple.com/download/more/?=xcode
https://download.developer.apple.com/Developer_Tools/Xcode_12.4/Xcode_12.4.xip
解凍して Application ディレクトリにつっこむ
terminalで

xcrun simctl erase all

参考:
https://mjeld.com/xcode-old-version-download-install/

https://qiita.com/tamaki/items/02eb43253193b950b08f
https://twitter.com/_mono/status/1388010007724130308

hndrhndr

原因切り分けのため別のMacでも試したが、こっちはこっちで別のエラー出たので対処中

hndr@hndrnoMacBook-Air cd ios
hndr@hndrnoMacBook-Air ios % arch -x86_64 pod update && arch -x86_64 pod install
Update all pods
Updating local specs repositories
Analyzing dependencies
firebase_analytics: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
firebase_auth: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
firebase_core: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
firebase_crashlytics: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
firebase_remote_config: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
Downloading dependencies
Installing FirebaseABTesting 7.11.0 (was 7.9.0)
Installing FirebaseInstallations 7.11.0 (was 7.9.0)
Installing GoogleUtilities 7.4.0 (was 7.1.1)
Installing PromisesObjC 1.2.12 (was 1.2.11)
Generating Pods project
Integrating client project
Pod installation complete! There are 15 dependencies from the Podfile and 32 total pods installed.

[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `Runner` to `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` or include the `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` in your build configuration (`Flutter/Release.xcconfig`).
Analyzing dependencies
firebase_analytics: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
firebase_auth: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
firebase_core: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
firebase_crashlytics: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
firebase_remote_config: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
Downloading dependencies
Generating Pods project
Integrating client project
Pod installation complete! There are 15 dependencies from the Podfile and 32 total pods installed.

[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `Runner` to `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` or include the `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` in your build configuration (`Flutter/Release.xcconfig`).
hndrhndr

eGPU

eGPU付けてるとiOSのBuildで失敗するのでGPUSelectionPolicyを追加
https://www.apple.com/jp/shop/product/HM8Y2J/A/blackmagic-egpu

Failed to build iOS app
Error output from Xcode build:
    2021-05-06 13:27:12.368 xcodebuild[57498:5025329] apply_selection_policy_once: prefer use of removable GPUs (via
    com.apple.dt.xcodebuild:GPUSelectionPolicy->preferRemovable)
    ** BUILD FAILED **

https://stackoverflow.com/questions/57219754/what-causes-apply-selection-policy-once-prefer-use-of-removable-gpus-on-high
https://developer.apple.com/documentation/metal/gpu_selection_in_macos/handling_external_gpu_additions_and_removals

/Library/Preferences/com.apple.dt.Xcode.plist

<key>GPUSelectionPolicy</key>
<string>avoidRemovable</string>

これでいいのかわからん

<key>GPUSelectionPolicy</key>
<string>preferRemovable</string>

こっちかな