Skip to content

Building an AppBundle using archivesBaseName fails. #126971

@kkkkan

Description

@kkkkan

Is there an existing issue for this?

Steps to reproduce

  1. Create a new project, for example using the flutter create bug command.
  2. Open projectRoot/android/app/gradle.
  3. Look for the following section:
android {

........

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.example.bug"
        // You can update the following values to match your application needs.
        // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
        minSdkVersion flutter.minSdkVersion
        targetSdkVersion flutter.targetSdkVersion
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

......

}
  1. Add archivesBaseName="abc" inside the defaultConfig section.
  2. Build the AppBundle using the flutter build appbundle command.

Expected results

  • The abc-release.aab file is created in projectRoot/build/app/outputs/bundle/release.
  • The log shows that the build was successful.

Actual results

  • The abc-release.aab file is created in projectRoot/build/app/outputs/bundle/release.
  • But the terminal log shows Gradle build failed to produce an .aab file..

Code sample

Code sample
.....
android {
    namespace "com.example.bug"
    compileSdkVersion flutter.compileSdkVersion
    ndkVersion flutter.ndkVersion

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = '1.8'
    }

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.example.bug"
        // You can update the following values to match your application needs.
        // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
        minSdkVersion flutter.minSdkVersion
        targetSdkVersion flutter.targetSdkVersion
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName

        archivesBaseName = "abc"
    }

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
    }
}

......

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs

It was too long, so I uploaded it as a txt file.
Here is the link.

https://pastebin.com/0E3wYXVb

Flutter Doctor output

Doctor output
[√] Flutter (Channel stable, 3.10.0, on Microsoft Windows [Version 10.0.22621.1555], locale ja-JP)
• Flutter version 3.10.0 on channel stable at C:\Users\xxxx\AppData\Local\flutter_windows_3.10.0-stable\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 84a1e904f4 (7 days ago), 2023-05-09 07:41:44 -0700
• Engine revision d44b5a94c9
• Dart version 3.0.0
• DevTools version 2.23.1
[√] Windows Version (Installed version of Windows is version 10 or higher)
[!] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
• Android SDK at C:\Users\xxxx\AppData\Local\Android\sdk
X cmdline-tools component is missing
Run `path/to/sdkmanager --install "cmdline-tools;latest"`
See https://developer.android.com/studio/command-line for more details.
X Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[√] Chrome - develop for the web
• Chrome at C:\Users\xxxx\AppData\Local\Google\Chrome\Application\chrome.exe
[!] Visual Studio - develop for Windows (Visual Studio Build Tools 2019 16.11.9)
• Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools
• Visual Studio Build Tools 2019 version 16.11.32106.194
X The current Visual Studio installation is incomplete. Please reinstall Visual Studio.
[√] Android Studio (version 2022.1)
• 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 11.0.15+0-b2043.56-9505619)
[√] Android Studio (version 2022.2)
• Android Studio at C:\Users\xxxx\Downloads\android-studio-2022.2.1.17-windows\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 17.0.6+0-b2043.56-9586694)
[√] Android Studio (version 2022.1)
• Android Studio at C:\Users\xxxx\Desktop\android-studio-2022.1.1.10-windows\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 11.0.15+0-b2043.56-8887301)
[√] VS Code (version 1.74.1)
• VS Code at C:\Users\xxxx\AppData\Local\Programs\Microsoft VS Code
• Flutter extension can be installed from:
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[√] Connected device (3 available)
• Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.22621.1555]
• Chrome (web)      • chrome  • web-javascript • Google Chrome 113.0.5672.93
• Edge (web)        • edge    • web-javascript • Microsoft Edge 112.0.1722.58
[√] Network resources
• All expected network resources are available.
! Doctor found issues in 2 categories.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listfound in release: 3.10Found to occur in 3.10found in release: 3.11Found to occur in 3.11has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versiont: gradle"flutter build" and "flutter run" on Androidteam-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