-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Framework support? #159
Comments
Cool!
I'm not aware of such limitation. The current flutter plugin architecture does the same. That being said, if this turns out to be a limitation, we can problably put all dylibs inside a "NativeAssets" framework inside the logic in https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/ios/native_assets.dart Exposing frameworks as part of the
We don't want to expose the static libs to xcodebuild at all. The goal is to link the dart aot snapshot with the static libraries with the native linker, so that all native code not referenced can be tree-shaken. dart-lang/sdk#49418 |
Tree shaking native code could be made to work without linking the Dart AOT snapshot together with the native code: Instead the native code can be compiled to a static archive which we can then link to a shared library without exporting unused symbols. (Theoretically an app can have 1 flutter engine <-> 2 Dart AOTed apps <-> 1 Native library.) |
The plugin architecture is using cocoapods on iOS, which results in one framework per plugin. About the bundle structure: https://developer.apple.com/documentation/bundleresources/placing_content_in_a_bundle?language=objc
This means there must be a framework for each dylib. In my experience if there are extra dylibs in framwework bundles the submission will fail with "invalid bundle structure". I think this can be resolved at flutter_tool level, simply package each dylib as a separate framework and link the framework with final executable, just bringing it up.
|
Thanks for the info @knopp!
That indeed sounds like the right thing to do. If you feel comfortable, you could try to make a PR in flutter_tools to do this. Please tag me, and I'll review and tag the Flutter team members that should review it. Otherwise I'll get to it at some point. |
FYI @vashworth |
This was addressed in flutter/flutter#140907 downstream. At this point we're not planning on supporting frameworks as output from |
Thanks! |
I'm hoping to replace a significant chunk of cargokit with native assets. I was looking at the model and the integration in Flutter tool, but it wasn't quite clear to me how frameworks are handled? There seem to be ony two types of assets (static lib and dylib).
The issue here is that iOS app store prevents putting dylibs in arbitrary locations (i.e. next to other frameworks). Each dylib must be packaged as a separate framework and there must to be nested frameworks. Any other layout, unless the rules changed very recently, will result in AppStore rejection.
The text was updated successfully, but these errors were encountered: