Skip to content

flutter build apk builds flx twice #15612

Closed

Description

@jensjoha

flutter clean ; time flutter build apk --debug --preview-dart-2

internally runs build flx twice (https://github.com/flutter/flutter/blob/master/packages/flutter_tools/gradle/flutter.gradle#L297).

Instrumenting the code so it prints when it builds flx makes it obvious; also removing the double-call makes stuff faster:

Without two calls:

flutter/examples/flutter_gallery$ flutter clean ; time flutter build apk --debug --preview-dart-2
Building flutter tool...
Deleting 'build/'.
Running "flutter packages get" in flutter_gallery...         0.5s
Initializing gradle...                                       0.6s
Resolving dependencies...                                    0.6s
Running 'gradlew assembleDebug'...                               
BUILDING FLX!!
Built build/app/outputs/apk/debug/app-debug.apk (37.3MB).

real	0m15.731s
user	0m4.856s
sys	0m0.592s

With two calls (i.e. as it currently is):

flutter/examples/flutter_gallery$ flutter clean ; time flutter build apk --debug --preview-dart-2
Deleting 'build/'.
Initializing gradle...                                       0.5s
Resolving dependencies...                                    0.6s
Running 'gradlew assembleDebug'...                               
BUILDING FLX!!
BUILDING FLX!!
Built build/app/outputs/apk/debug/app-debug.apk (37.3MB).

real	0m18.106s
user	0m3.780s
sys	0m0.508s

/cc @mraleph @mravn-google @szakarias

Activity

  1. szakarias commented on Mar 25, 2018

    @szakarias
    Contributor

    Thanks, @jensjoha. There has earlier been a reason for building twice, but it is not necessary anymore. I'll make sure to remove the extra build step.

  2. self-assigned this
    on Mar 25, 2018
  3. szakarias commented on Apr 12, 2018

    @szakarias
    Contributor

    Fixed in #16416

  4. github-actions commented on Sep 3, 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.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions