Skip to content

flutter build apk --target-platform=android-arm64 still builds a FAT apk #169413

Open
@stan-at-work

Description

@stan-at-work

Steps to reproduce

When you run: flutter build apk --target-platform=android-arm64 --split-per-abi the output is as desired. Only one apk file is generated.

But when you omit the --split-per-abi, just flutter build apk --target-platform=android-arm64.

It generates all the apk files (not only for android-arm64 like specified).

Expected results

This is verbose and should realy just generate only the --target-platform nothing else. Why else would we pass this parameter, as it just generates the same passing no parameter.

I expect the same result as running: flutter build apk --target-platform=android-arm64 --split-per-abi

PS C:\repo\applications\lisatruck> flutter build apk --target-platform=android-arm64 --split-per-abi
Resolving dependencies...
Downloading packages... (1.1s)
  desktop_drop 0.5.0 (0.6.0 available)
! device_frame_plus 1.3.0 (overridden) (1.3.1 available)
  device_info_plus 10.1.2 (11.4.0 available)
  file_picker 8.3.7 (10.1.9 available)
  flutter_secure_storage_linux 1.2.3 (2.0.1 available)
  flutter_secure_storage_macos 3.1.3 (4.0.0 available)
  flutter_secure_storage_platform_interface 1.1.2 (2.0.1 available)
  flutter_secure_storage_web 1.2.1 (2.0.0 available)
  flutter_secure_storage_windows 3.1.2 (4.0.0 available)
! intl 0.20.2 (overridden)
  js 0.6.7 (0.7.2 available)
  material_color_utilities 0.11.1 (0.12.0 available)
  meta 1.16.0 (1.17.0 available)
  mobile_scanner 5.2.3 (7.0.0 available)
  permission_handler 11.4.0 (12.0.0+1 available)
  permission_handler_android 12.1.0 (13.0.1 available)
  pointycastle 3.9.1 (4.0.0 available)
  share_plus 10.1.4 (11.0.0 available)
  share_plus_platform_interface 5.0.2 (6.0.0 available)
  signature 5.5.0 (6.0.0 available)
  url_strategy 0.2.0 (0.3.0 available)
  uuid 3.0.7 (4.5.1 available)
  vector_graphics_compiler 1.1.16 (1.1.17 available)
  vector_math 2.1.4 (2.2.0 available)
  win32_registry 1.1.5 (2.1.0 available)
Got dependencies!
24 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.
Your project is configured with Android NDK 26.3.11579264, but the following plugin(s) depend on a different Android NDK version:
- app_links requires Android NDK 27.0.12077973
- connectivity_plus requires Android NDK 27.0.12077973
- desktop_drop requires Android NDK 27.0.12077973
- device_info_plus requires Android NDK 27.0.12077973
- file_picker requires Android NDK 27.0.12077973
- flutter_datawedge requires Android NDK 27.0.12077973
- flutter_image_compress_common requires Android NDK 27.0.12077973
- flutter_inappwebview_android requires Android NDK 27.0.12077973
- flutter_plugin_android_lifecycle requires Android NDK 27.0.12077973
- flutter_secure_storage requires Android NDK 27.0.12077973
- flutter_web_auth_2 requires Android NDK 27.0.12077973
- image_picker_android requires Android NDK 27.0.12077973
- map_launcher requires Android NDK 27.0.12077973
- mobile_scanner requires Android NDK 27.0.12077973
- package_info_plus requires Android NDK 27.0.12077973
- path_provider_android requires Android NDK 27.0.12077973
- pdfrx requires Android NDK 27.0.12077973
- permission_handler_android requires Android NDK 27.0.12077973
- protocol_handler_android requires Android NDK 27.0.12077973
- protocol_handler_android requires Android NDK 27.0.12077973
- protocol_handler_android requires Android NDK 27.0.12077973
- protocol_handler_android requires Android NDK 27.0.12077973
- protocol_handler_android requires Android NDK 27.0.12077973
- protocol_handler_android requires Android NDK 27.0.12077973
- protocol_handler_android requires Android NDK 27.0.12077973
- protocol_handler_android requires Android NDK 27.0.12077973
- protocol_handler_android requires Android NDK 27.0.12077973
- protocol_handler_android requires Android NDK 27.0.12077973
- protocol_handler_android requires Android NDK 27.0.12077973
- share_plus requires Android NDK 27.0.12077973
- shared_preferences_android requires Android NDK 27.0.12077973
- url_launcher_android requires Android NDK 27.0.12077973
Fix this issue by using the highest Android NDK version (they are backward compatible).
Add the following to C:\repo\applications\lisatruck\android\app\build.gradle.kts:

    android {
        ndkVersion = "27.0.12077973"
        ...
    }
Expected to find fonts for (MaterialIcons, packages/cupertino_icons/CupertinoIcons, packages/font_awesome_flutter/FontAwesomeRegular), but found (MaterialIcons, packages/font_awesome_flutter/FontAwesomeRegular). This usually means you are referring to font families in an IconData class but not including them in the assets section of your pubspec.yaml, are missing the package that would include them, or are missing "uses-material-design: true".
Font asset "fa-sharp-regular-400.ttf" was tree-shaken, reducing it from 943300 to 871940 bytes (7.6% reduction). Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app.
Font asset "MaterialIcons-Regular.otf" was tree-shaken, reducing it from 1645184 to 11360 bytes (99.3% reduction). Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app.
warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
3 warnings
warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
3 warnings
warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
3 warnings
warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
3 warnings
warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
3 warnings
warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
3 warnings
Running Gradle task 'assembleRelease'...                          178.8s
√ Built build\app\outputs\flutter-apk\app-arm64-v8a-release.apk (17.9MB)

Image

Actual results

> flutter build apk --target-platform=android-arm64
Resolving dependencies... 
Downloading packages... (1.0s)
  desktop_drop 0.5.0 (0.6.0 available)
! device_frame_plus 1.3.0 (overridden) (1.3.1 available)
  device_info_plus 10.1.2 (11.4.0 available)
  file_picker 8.3.7 (10.1.9 available)
  flutter_secure_storage_linux 1.2.3 (2.0.1 available)
  flutter_secure_storage_macos 3.1.3 (4.0.0 available)
  flutter_secure_storage_platform_interface 1.1.2 (2.0.1 available)
  flutter_secure_storage_web 1.2.1 (2.0.0 available)
  flutter_secure_storage_windows 3.1.2 (4.0.0 available)
! intl 0.20.2 (overridden)
  js 0.6.7 (0.7.2 available)
  material_color_utilities 0.11.1 (0.12.0 available)
  meta 1.16.0 (1.17.0 available)
  mobile_scanner 5.2.3 (7.0.0 available)
  permission_handler 11.4.0 (12.0.0+1 available)
  permission_handler_android 12.1.0 (13.0.1 available)
  pointycastle 3.9.1 (4.0.0 available)
  share_plus 10.1.4 (11.0.0 available)
  share_plus_platform_interface 5.0.2 (6.0.0 available)
  signature 5.5.0 (6.0.0 available)
  url_strategy 0.2.0 (0.3.0 available)
  uuid 3.0.7 (4.5.1 available)
  vector_graphics_compiler 1.1.16 (1.1.17 available)
  vector_math 2.1.4 (2.2.0 available)
  win32_registry 1.1.5 (2.1.0 available)
Got dependencies!
24 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.
Your project is configured with Android NDK 26.3.11579264, but the following plugin(s) depend on a different Android NDK version:
- app_links requires Android NDK 27.0.12077973
- connectivity_plus requires Android NDK 27.0.12077973
- desktop_drop requires Android NDK 27.0.12077973
- device_info_plus requires Android NDK 27.0.12077973
- file_picker requires Android NDK 27.0.12077973
- flutter_datawedge requires Android NDK 27.0.12077973
- flutter_image_compress_common requires Android NDK 27.0.12077973
- flutter_inappwebview_android requires Android NDK 27.0.12077973
- flutter_plugin_android_lifecycle requires Android NDK 27.0.12077973
- flutter_secure_storage requires Android NDK 27.0.12077973
- flutter_web_auth_2 requires Android NDK 27.0.12077973
- image_picker_android requires Android NDK 27.0.12077973
- map_launcher requires Android NDK 27.0.12077973
- mobile_scanner requires Android NDK 27.0.12077973
- package_info_plus requires Android NDK 27.0.12077973
- path_provider_android requires Android NDK 27.0.12077973
- pdfrx requires Android NDK 27.0.12077973
- permission_handler_android requires Android NDK 27.0.12077973
- protocol_handler_android requires Android NDK 27.0.12077973
- share_plus requires Android NDK 27.0.12077973
- shared_preferences_android requires Android NDK 27.0.12077973
- url_launcher_android requires Android NDK 27.0.12077973
Fix this issue by using the highest Android NDK version (they are backward compatible).
Add the following to C:\repo\applications\lisatruck\android\app\build.gradle.kts:

    android {
        ndkVersion = "27.0.12077973"
        ...
    }
Expected to find fonts for (MaterialIcons, packages/cupertino_icons/CupertinoIcons, packages/font_awesome_flutter/FontAwesomeRegular), but found (MaterialIcons, packages/font_awesome_flutter/FontAwesomeRegular). This usually means you are referring to font families in an IconData class but not including them in the assets section of your pubspec.yaml, are missing the package that would include them, or are missing "uses-material-design: true".
Font asset "fa-sharp-regular-400.ttf" was tree-shaken, reducing it from 943300 to 871940 bytes (7.6% reduction). Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app.
Font asset "MaterialIcons-Regular.otf" was tree-shaken, reducing it from 1645184 to 11360 bytes (99.3% reduction). Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app.
warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
3 warnings
warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
3 warnings
warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
3 warnings
warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
3 warnings
warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
3 warnings
warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
3 warnings
Running Gradle task 'assembleRelease'...                          178.8s
√ Built build\app\outputs\flutter-apk\app-release.apk (30.6MB)

Image

Code sample

You can use the default flutter app

Screenshots or Video

No response

Logs

No response

Flutter Doctor output

[√] Flutter (Channel stable, 3.32.0, on Microsoft Windows [Version 10.0.26100.4061], locale en-BE)
[1,104ms]
• Flutter version 3.32.0 on channel stable at C:\repo\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision be698c4 (5 days ago), 2025-05-19 12:59:14 -0700
• Engine revision 1881800
• Dart version 3.8.0
• DevTools version 2.45.1

[√] Windows Version (Windows 11 or higher, 24H2, 2009) [5.2s]

[√] Android toolchain - develop for Android devices (Android SDK version 35.0.1) [3.6s]
• Android SDK at C:\Users\usr\AppData\Local\Android\sdk
• Platform android-35, build-tools 35.0.1
• Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: flutter config --jdk-dir="path/to/jdk".
• Java version OpenJDK Runtime Environment (build 21.0.4+-12508038-b607.1)
• All Android licenses accepted.

[√] Chrome - develop for the web [430ms]
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.12.4) [427ms]
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.12.35707.178
• Windows 10 SDK version 10.0.26100.0

[√] Android Studio (version 2024.2) [50ms]
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 21.0.4+-12508038-b607.1)

[√] VS Code (version 1.100.2) [47ms]
• VS Code at C:\Users\usr\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.110.0

[√] Connected device (2 available) [604ms]
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.26100.4061]
• Chrome (web) • chrome • web-javascript • Google Chrome 135.0.7049.115

[√] Network resources [633ms]
• All expected network resources are available.

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: buildBuilding flutter applications with the toolc: new featureNothing broken; request for a new capabilityfound in release: 3.32Found to occur in 3.32found in release: 3.33Found to occur in 3.33has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyteam-androidOwned by Android platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-androidTriaged by Android platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions