Build Flutter app as a framework on iOS#8971
Merged
cbracken merged 3 commits intoflutter:masterfrom Mar 23, 2017
Merged
Conversation
Dynamic libraries outside of a framework bundle are not supported on iOS, except for the system Swift libraries provided by Xcode. See: https://developer.apple.com/library/content/technotes/tn2435/_index.html#//apple_ref/doc/uid/DTS40017543-CH1-TROUBLESHOOTING_BUNDLE_ERRORS-EMBEDDED__DYLIB_FILES
Member
Author
|
Fixes #8075 |
xster
approved these changes
Mar 22, 2017
Member
xster
left a comment
There was a problem hiding this comment.
Should we rename the frameworks too?
chinmaygarde
approved these changes
Mar 23, 2017
| <key>CFBundleExecutable</key> | ||
| <string>App</string> | ||
| <key>CFBundleIdentifier</key> | ||
| <string>io.flutter.flutter.app</string> |
Contributor
There was a problem hiding this comment.
Will this be true? Won't this need to be unique to the app in question?
Contributor
There was a problem hiding this comment.
Eh, I doubt it matters.
Contributor
There was a problem hiding this comment.
That is the identifier of the framwork, the application identifier is still specified in a separate Info.plist.
mravn-google
added a commit
to mravn-google/flutter
that referenced
this pull request
Mar 23, 2017
mravn-google
added a commit
that referenced
this pull request
Mar 23, 2017
mravn-google
added a commit
to mravn-google/flutter
that referenced
this pull request
Mar 23, 2017
mravn-google
added a commit
that referenced
this pull request
Mar 23, 2017
Closed
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
THIS IS A BREAKING CHANGE. See below for migration steps for existing projects.
Previously, Flutter app code was built as a raw dylib on iOS. Dynamic libraries outside of a framework bundle are not supported on iOS, except for the system Swift libraries provided by Xcode.
See:
https://developer.apple.com/library/content/technotes/tn2435/_index.html#//apple_ref/doc/uid/DTS40017543-CH1-TROUBLESHOOTING_BUNDLE_ERRORS-EMBEDDED__DYLIB_FILES
app.dylibtoApp.frameworkflutter createtemplateMigration steps for existing projects
The following steps should be taken from the root of your Flutter project:
ios/.gitignore: add/Flutter/App.frameworkon a new line.app.dylibfrom the Flutter folder. Delete this file from theios/Flutterdirectory in your project.ios/Flutter/App.framework. From the command line, runflutter build ios. If you have not configured app signing in Xcode, an alternative method is to open the simulator, then runflutter run -d iP.Runnerproject. In the project settings that are displayed in the main view, ensure that theRunnertarget is selected. You can verify this by exposing the sidebar using the [| ] icon in the upper-left corner of the main view.App.framework. In the sheet that drops down, click the Add Other... button. Navigate to theios/Flutterdirectory and selectApp.framework. Click Open. In the sheet that drops down, select Create folder references, then click Finish.App.frameworkhas been added to the Embedded Binaries and Linked Frameworks and Libraries lists.App.frameworkunder the Flutter folder.ios/Flutterdirectory of your project.Flutterthen from the File menu, select Add Files to "Runner".... Navigate to theios/Flutterdirectory, selectAppFrameworkInfo.plistand clickthe Add button.
flutter build clean, thenflutter run.The final state of your project should appear as follows:

At this point your project should be fully migrated.