Flutter 프로젝트에서 개발하다가 갑자기 핫리로드가 정상적으로 돌지 않게 되었어요.
문제의 원인은 BuildOwner.scheduleBuildFor() called inappropriately
이지만 어떻게 해결할지 몰라서 Gemini의 조언대로 flutter clean
명령을 수행했어요. 그런 다음 flutter pub outdated
를 실 해보니 몇 개의 패키지가 버전을 올릴 수 있다고 알려줬어요.
flutter pub upgrade --major-versions
를 통해 해당하는 패키지들의 버전을 올렸어요.
다 된 것 같아 프로젝트를 실행하려고 하니 firebase쪽 패키지에서 문제가 생겨 돌아가지 않았어요. 원래 원인이 해결되었는지도 확인하지 못한 채 새로운 오류를 만났어요. 🥲
저 부분은 제가 ios/Podfile에 추가해 줬던 기억이 있어서 버전을 아래처럼 올려줬어요. Firebase를 사용하는 경우에 아래 코드를 추가하면 빌드가 더 빨리 끝나기 때문에 넣어줬었어요.
target 'Runner' do
use_frameworks!
use_modular_headers!
pod 'FirebaseFirestore',
:git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git',
:tag => '11.0.0'
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
inherit! :search_paths
end
end
저렇게 버전을 올리고 VS Code에서 F5를 눌러 개발 모드로 빌드를 했는데도 프로젝트의 문제가 있다며 실행이 되질 않았어요.
실행하면 DEBUG CONSOLE에 노란색 글씨로 어떻게 해보라는 글이 있어 pod repo update
와 pod install --repo-update
를 시도했지만 해결되지 않았어요.
그러다가 pod update Firebase/Auth
를 해보라는 지시를 따랐고 빌드가 정상적으로 수행되었어요.
여러분도 패키지 버전을 올리고 Firebase쪽이 안되는 경우에는 문제가 되는 패키지를 pod update
해보세요!
The lure of the distant and the difficult is deceptive. The great opportunity is where you are.
— John Burroughs