Skip to content

Support flutter build aar #26099

Closed
Closed

Description

@xster

I feel like there must be an existing bug but I can't find one.

One concrete solution/option to #25979

More or less #25323 and #24948

cc @dnfield

Activity

  1. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    t: gradle"flutter build" and "flutter run" on Android
    a: existing-appsIntegration with existing apps via the add-to-app flow
    t: xcode"xcodebuild" on iOS and general Xcode project management
    on Jan 5, 2019
  2. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    and removed
    toolAffects the "flutter" command-line tool. See also t: labels.
    on Jan 8, 2019
  3. vvarp commented on Feb 6, 2019

    @vvarp

    Anyone care to share their current best approach for generating easily embeddable aar/framework?

    We started work on this about 2 weeks ago and we ended up with such convoluted structure that I am afraid it might break any moment now. On top of this we are seeing quite a lot of issues when using plugins that pull in additional dependencies, and we are going off on patching spree almost every day.

    Right now our setup consist of separate subproject for each platform, with plenty of glue in form of Python scripts extracting bits and pieces from different build dirs and putting together contents for a podspec (iOS), or with dancing around dependencies problem using fat-aar (Android).

    I appreciate the fact that we are still in the early days and easy embedding Flutter views in existing apps isn't the most chased/desired feature, but I have a feeling that we're not first ones trying to achieve that, and there might be some unheard success stories!

  4. neiljaywarner commented on Mar 1, 2019

    @neiljaywarner

    @vvarp Please let me know if you come up with anything good. I am also curious when we will not be in the early days... and for enterprise it is a desired feature right?

  5. dnfield commented on Mar 13, 2019

    @dnfield
    Contributor

    #29328 would help this

  6. self-assigned this
    on May 2, 2019
  7. xster commented on Jun 4, 2019

    @xster
    MemberAuthor

    Here's a sample of what Alibaba did to breakdowns our existing xcode_backend.sh to produce .frameworks

    fwn_repo_path=$(pwd)
    export FLUTTER_ROOT="${fwn_repo_path}/flutter"
    export FLUTTER_APPLICATION_PATH="${fwn_repo_path}"
    export FLUTTER_BUILD_MODE="${build_mode}"
    export SOURCE_ROOT="${fwn_repo_path}/ios"
    export ARCHS="armv7 arm64"
    export SDKROOT="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk"
    /bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" build
    
    # Call LC_LOAD_DYLIB, otherwise it crashes on iOS 9.
    if [ "$build_mode" = "release" ];then
        echo "===注入LC_LOAD_DYLIB命令==="
        echo "Injecting LC_LOAD_DYLIB command..."
        sync_tools/insert_dylib /usr/lib/libSystem.B.dylib build/aot/App.framework/App
        rm -rf build/aot/App.framework/App
        cp build/aot/App.framework/App_patched build/aot/App.framework/App
        rm -rf build/aot/App.framework/App_patched
    fi

    cc @jonahwilliams

  8. xster commented on Jun 4, 2019

    @xster
    MemberAuthor

    Note from @mehmetf, we should take care to cover outputting modules with fat binaries.

  9. xster commented on Jun 6, 2019

    @xster
    MemberAuthor

    #22102 is an Android sub-bug

  10. xster commented on Jun 13, 2019

    @xster
    MemberAuthor

    Although #22102 is a subset and useful on its own (such as using include_flutter.groovy and being able to access resources) but nevertheless, we'll necessarily solve it while doing this.

  11. xster commented on Jul 25, 2019

    @xster
    MemberAuthor

    Based on @blasten's feedback, splitting Android and iOS work. iOS is in #36968

    I think the remaining work for Android is continuing to monitor the flutter build aar command on master and to update the documentation for add-to-app.

  12. changed the title [-]Support flutter build module/aar/framework[/-] [+]Support flutter build aar[/+] on Jul 25, 2019
  13. truongsinh commented on Aug 2, 2019

    @truongsinh
    Contributor

    flutter build aar is now available on 1.8.3, should we close this issue?

  14. blasten commented on Aug 2, 2019

    @blasten

    Yeah!

  15. added
    a: annoyanceRepeatedly frustrating issues with non-experimental functionality
    on Sep 11, 2019
  16. github-actions commented on Aug 28, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  17. locked as resolved and limited conversation to collaborators on Aug 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

a: annoyanceRepeatedly frustrating issues with non-experimental functionalitya: existing-appsIntegration with existing apps via the add-to-app flowt: gradle"flutter build" and "flutter run" on Androidt: xcode"xcodebuild" on iOS and general Xcode project managementtoolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions