Upgrading Flutter added to existing iOS Xcode project
(This wiki page applies to people who added Flutter to an existing iOS application before August 2019.)
Prior to pull request flutter/flutter#36793 merged on July 30, 2019 (Flutter 1.8.4-pre.21
), adding Flutter to an existing iOS application required changes to the Podfile and adding a Run Script build phase to the existing Xcode project. To update to Flutter past this pull request, you must alter your Podfile, delete the Run Script build phase, and regenerate the podhelper script.
The instructions have been updated on the Add Flutter to existing apps Wiki page. Ensure you are on the master channel and run
flutter upgrade
before following these instructions.
Previously, the following lines needed to be added to the Podfile
:
flutter_application_path = 'path/to/my_flutter/'
eval(File.read(File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')), binding)
This should be updated to:
flutter_application_path = 'path/to/my_flutter/'
load File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')
target 'MyApp' do
install_all_flutter_pods(flutter_application_path)
end
target 'MyAppTests' do
install_all_flutter_pods(flutter_application_path)
end
Previously, a build phase needed to be added to the existing Xcode project:
"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" build
"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" embed
This build phase is no longer necessary and must be deleted.
cd 'path/to/my_flutter/'
rm .ios/Flutter/podhelper.rb
flutter build ios
- Home of the Wiki
- Roadmap
- API Reference (stable)
- API Reference (main)
- Glossary
- Contributor Guide
- Chat on Discord
- Design documents
- Code of Conduct
- Issue triage reports (latest)
- Our Values
- Tree hygiene
- Issue hygiene and Triage
- Style guide for Flutter repo
- Project teams
- Contributor access
- What should I work on?
- Popular issues
- Running and writing tests
- Release process
- Flutter Framework Gardener Rotation
- Rolling Dart
- Manual Engine Roll with Breaking Commits
- Updating Material Design Fonts & Icons
- Postmortems and Retrospectives
- Hotfix Documentation Best Practices
- In case of emergency
- Landing Changes With Autosubmit
- Setting up the Framework development environment
- The Framework architecture
- API Docs code block generation
- Running examples
- Using the Dart analyzer
- The flutter run variants
- Test coverage for package:flutter
- Writing a golden-file test for package:flutter
- Managing template image assets
- Setting up the Engine development environment
- Compiling the engine
- Debugging the engine
- Using Sanitizers with the Flutter Engine
- Testing the engine
- The Engine architecture
- Flutter's modes
- Crashes
- more...
- Setting up the Packages development environment
- Plugins and Packages repository structure
- Contributing to Plugins and Packages
- Understanding Packages tests
- Plugin Tests
- Releasing a Plugin or Package
- more...