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.
Previously, the following lines needed to be added to the
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
Build phase for building the Dart code
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