The personal finance app for everyone (by everyone)
iOS Build Guide
Issue Diagnosis: module 'flutter_secure_storage' not found
Root Cause
This error occurs because CocoaPods dependencies have not been installed. flutter_secure_storage is a Flutter plugin that requires native platform support, and its iOS native code must be installed via CocoaPods.
Solution
First-time Setup or After Dependency Updates
# 1. Get Flutter dependencies
flutter pub get
# 2. Navigate to iOS directory and install CocoaPods dependencies
cd ios
pod install
cd ..
Clean Build (if encountering issues)
# Clean Flutter build cache
flutter clean
# Re-fetch dependencies
flutter pub get
# Clean and reinstall Pods
cd ios
rm -rf Pods Podfile.lock
pod install
cd ..
Local Building
Method 1: Using Flutter CLI
# Debug mode
flutter build ios --debug
# Release mode (requires Apple Developer certificate)
flutter build ios --release
# Release mode (no code signing, for build testing only)
flutter build ios --release --no-codesign
Method 2: Using Xcode
- Ensure you have run
pod install - Open
ios/Runner.xcworkspace(Note: NOT .xcodeproj) - Select target device or simulator
- Click Run button or press Cmd+R
CI/CD Automated Builds
GitHub Actions Workflow
The project is configured with automated iOS build process, triggered by:
- Push to
mainbranch - Pull Requests
- Manual trigger (workflow_dispatch)
Build Steps
- Environment Setup: macOS runner + Flutter 3.32.4
- Dependency Installation:
flutter pub get+pod install - Code Analysis:
flutter analyze - Test Execution:
flutter test - iOS Build:
flutter build ios --release --no-codesign - Artifact Upload: Built .app file saved as artifact for 30 days
Viewing Build Artifacts
- Go to GitHub Actions page
- Select the corresponding workflow run
- Download
ios-build-unsignedartifact
Note: CI-built versions are not code-signed and cannot be installed directly on physical devices.
Code Signing and Distribution
Configuring Code Signing
To publish to the App Store or install on physical devices, you need:
- Apple Developer Account (Individual or Enterprise)
- Developer Certificates
- Development Certificate
- Distribution Certificate
- Provisioning Profile
- App ID registered in Apple Developer Portal
Configuration in Xcode
- Open
ios/Runner.xcworkspace - Select Runner target
- Go to "Signing & Capabilities" tab
- Set Team (requires Apple ID login)
- Set Bundle Identifier
- Xcode will automatically manage certificates and Provisioning Profile
Building IPA for Distribution
# Build and archive using Xcode
flutter build ipa --release
# IPA file location
# build/ios/ipa/*.ipa
System Requirements
Development Environment
- macOS 12.0 or higher
- Xcode 14.0 or higher
- CocoaPods 1.11 or higher
- Flutter 3.32.4 (recommended)
Minimum iOS Version
- iOS 12.0 (defined in
ios/Podfile)
Common Issues
Q: Why use .xcworkspace instead of .xcodeproj?
A: When a project uses CocoaPods, Pod dependencies are organized into a separate Xcode project. The .xcworkspace file contains both the main project and the Pods project, and must be used to ensure all dependencies are properly loaded.
Q: What to do after updating pubspec.yaml?
A: After adding or updating dependencies, you need to run:
flutter pub get
cd ios && pod install && cd ..
Q: What if CI build fails?
A: Common causes:
- Flutter version mismatch
- Dependency conflicts
- Pod installation failure
- Code analysis or test failures
Check GitHub Actions logs for detailed error information.
Q: How to configure code signing in CI?
A: You need to configure GitHub Secrets:
- Apple certificate (.p12 format, base64 encoded)
- Provisioning Profile
- Certificate password
- Keychain setup
This requires additional configuration steps. Currently, CI uses the --no-codesign option for unsigned builds.