플러터에서 파이어베이스 연동을 하는 과정에서 다음과 같은 오류를 발견했다.
아주 지긋지긋했다 몇 시간동안 이 오류를 본건지...
Launching lib/main.dart on iPhone 14 Pro in debug mode...
Running pod install... 8.2s
Running Xcode build...
Xcode build done. 6.4s
Failed to build iOS app
Error (Xcode): unsupported option '-G' for target
'x86_64-apple-ios15.0-simulator'
Could not build the application for the simulator.
Error launching application on iPhone 14 Pro.
처음에는 Xcode와 프로젝트, 시뮬레이터간 버전 통일이 안 됐나 싶었고
Podfile 바꿔보고 뭐시기 뭐시기... 후... 다 해본 것 같음...
https://github.com/grpc/grpc/pull/36904
결론적으로 Firebase와 Xcode 16버전간 복합적인 요인이 있어 보였다.
그런데 플러스로 M1칩과의 연동도 문제였음.
결국 난리를 치다가
https://th-biglight.tistory.com/24
M1에서 Firebase 사용시 오류
현재 macbook air M1칩을 사용중인 나에게 Firebase 관련 오류가 발생했다. [!] CocoaPods could not find compatible versions for pod "Firebase/Firestore": In Podfile: cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`) was resolve
th-biglight.tistory.com
이 분의 포스팅을 참고하여 고쳤음.
# Podfile.lock, Pods 제거 후
1 .arch -x86_64 sudo gem install cocoapods -n /usr/local/bin
2. sudo gem install cocoapods -n /usr/local/bin
3. sudo arch -x86_64 gem install ffi
4. arch -x86_64 pod install --repo-update
위와 같이 M1 터미널에서 설정을 바꿔주고,
안드로이드 스튜디오 내 플러터 프로젝트에서 시뮬레이터를 실행시키지 말고
Xcode 내에서 플러터 Runner 프로젝트 열고, 16 Pro를 설정해서 띄워보니 잘 됐다.
그리고 추가로 이 작업도 해줬음.
Xcode에서 위 이미지처럼 처리해줬음. default로는 No로 되어 있는데
뭐 포함된 모듈 아니면 허락하지 않는걸 허락하게 만들어주는 설정해주는 그런 것임.
위 내용은 아래 링크 참고 했음.
How to fix: ‘cloud_firestore: unsupported option ‘-G’ for target ‘x86_64-apple-ios10.0-simulator’
First, I updated my Podfile:
medium.com
자... 이제 다시 해피 플러터 코딩...