-
공유일기 앱 만들기 - 2Flutter 2025. 4. 29. 21:28
지난주에 하려던 만큼 못 했어요.
중간에 상태관리 쪽에 이슈가 생겨서 계속 막혀있었어요.
어떻게든 조금씩 버그만 수정하는 식으로 버텼는데 이제는 너무 뒤죽박죽이 되어버렸어요.
구현을 잠깐 멈추고 모르고 그냥 쓰던 riverpod 문서도 읽고 프로젝트 구조도 변경했어요.
구현은 못했지만 프로젝트 구조랑 코드 자체는 더 깔끔해졌어요.
변경사항
MVVM 아키텍처로 변경
- https://docs.flutter.dev/app-architecture/guide
- https://github.com/namanh11611/flutter_mvvm_riverpod
- https://github.com/flutter/samples/tree/main/compass_app
- https://github.com/bizz84/starter_architecture_flutter_firebase
- https://github.com/Uuttssaavv/flutter-clean-architecture-riverpodgo_router, freezed, shared_preferences 패키지 추가
- https://pub.dev/packages/go_router
- https://pub.dev/packages/freezed
- https://pub.dev/packages/shared_preferences
빌드
아이폰에서 개발자 모드 활성화하기
- Settings - Privacy & Security - Developer Mode
- Developer Mode 가 안 보일때는 Xcode - Window - Devices and Simulators
아이폰 빌드 이슈1
`No development certificates available to code sign app for device deployment`
- `open ios/Runner.xcworkspace`
- Xcode Runner -> Targets - Runner -> Signing & Capabilities -> Team - 개발자 계정 선택
- Xcode -> Settings -> Accounts에서 Apple ID 추가
아이폰 빌드 이슈 2`Module 'cloud_firestore' not found`
```
[!] CocoaPods could not find compatible versions for pod "cloud_firestore":
In Podfile:
cloud_firestore (from `. symlinks/plugins/cloud_firestore/ios`)
```- https://stackoverflow.com/questions/64362285/flutter-on-ios-fatal-error-module-cloud-firestore-not-found
- iOS 최소 배포 버전 업그레이드
- ios/Podfile
- `platform :ios, '13.0'`
- Xcode
- Runner target -> General - Minimum Deployments 13.0 이상으로 설정
- ios/Podfile
CocoaPods 캐시 삭제flutter clean rm -rf ios/Podfile.lock ios/Pods ios/Runner.xcworkspace pod cache clean --all rm -rf ~/Library/Caches/CocoaPods rm -rf ~/Library/Developer/Xcode/DerivedData/*
의존성 재설치 (애플 실리콘 칩셋)cd ios arch -x86_64 pod install --repo-update cd ..
Xcode -> Product -> Clean Build Folder -> Run
아이폰 빌드 이슈 3: 구글 로그인 연동 시 필요한 URL Scheme 등록
Your app is missing support for the following URL schemes...
- GoogleService-Info.plist에서 REVERSED_CLIENT_ID 복사
- Xcode - Runner -> GoogleService-Info.plist `REVERSED_CLIENT_ID` 값 복사
- Info.plist에 URL Scheme 추가
- Xcode - Runner - target -> Info -> URL Types + 버튼 -> URL Schemes에 `REVERSED_CLIENT_ID` 값 붙여 넣기
아이폰 빌드 이슈 4: 아이폰에서 릴리즈 빌드 설치하기- Debug mode로 설치된 앱은 디버깅 세션이 끊기면 앱이 작동하지 않거나 실행되지 않을 수 있음.
- Xcode - Product -> Scheme -> Edit Scheme (Release로 변경)
잡동사니
앱 테마 컬러 정할 때 참조
생각들
- 아이폰 빌드를 하려니 맥북이 매우 뜨거워진다.
- 처음에 패키지 이것저것 없이 기본기능으로만 개발해야 나중에 패키지 가져다 쓰는 것도 더 편해진다.
- 문서 대충 보고 하면 결국에 문서 보러 다시 돌아온다. 시간을 오히려 더 씀. 알면서도 반복하는 잘못,,,
- 기능을 어느 정도 구현하면 잠깐 멈추고 진행상황을 뒤돌아봐야 한다. 잘 된다고 계속하다가 큰 그림을 잘못 보고 진행함.
- 다른 좋은 프로젝트 구조를 많이 따라 하는데, 나중에 그러다 참조할만한 프로젝트를 못 찾으면 혼자 진행을 못하지 않을까 싶다.
구현 진행이 느려서 아쉬워요...
3편에서는 진전이 있길...
'Flutter' 카테고리의 다른 글
공유일기 앱 만들기 - 1 (1) 2025.04.22 공유일기 앱 만들기 - 0 (0) 2025.04.15