Repository navigation
Closed
Labels
c: regressionIt was better in the past than it is nowfound in release: 3.50Found to occur in 3.50has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyt: gradle"flutter build" and "flutter run" on Androidteam-androidOwned by Android platform teamtoolAffects the "flutter" command-line tool. See also t: labels.
Description
Steps to reproduce
This is exactly the same issue as #169215, which resurfaced in Flutter v3.50, so I'll copy/paste the steps, etc. as they are the same.
After installing Flutter 3.50, we cannot use a custom Android app suffix id for the profile mode. We use <app_id>.profile as the app id on Android to be able to install different flavors in parallel.
It seems to happen only when a native plugin is installed, like shared_preferences.
To reproduce
flutter create counterflutter pub add shared_preferences- Add the suffix configuration to
android/app/build.gradle.ktsin thebuildTypessection
android {
buildTypes {
getByName("profile") {
applicationIdSuffix = ".profile"
versionNameSuffix = "-PROFILE"
signingConfig = signingConfigs.getByName("debug")
}
}
}flutter run(running on debug mode triggers the issue. No need to run in profile mode)
Expected results
Run successfully
Actual results
It doesn't run
Code sample
Demo app with minor tweaks described above are enough
Screenshots or Video
No response
Logs
Logs
$ flutter run
Launching lib/main.dart on XQ DE72 in debug mode...
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':jni'.
> com.android.builder.errors.EvalIssueException: Library projects cannot set applicationIdSuffix. applicationIdSuffix is set to '.profile' in build type 'profile'.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights from a Build Scan (powered by Develocity).
> Get more help at https://help.gradle.org.
BUILD FAILED in 1s
Running Gradle task 'assembleDebug'... 1,757ms
Error: Gradle task assembleDebug failed with exit code 1Flutter Doctor output
Doctor output
$ flutter doctor -v
[✓] Flutter (Channel stable, 3.50.0, on Ubuntu 26.04.1 LTS 7.0.0-43-generic, locale en_GB.UTF-8) [67ms]
• Flutter version 3.50.0 on channel stable at /home/tibo/code/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision ab2912035e (2 days ago), 2026-11-09 08:50:21 -0800
• Engine revision 371f77202a
• Dart version 3.14.0
• DevTools version 2.61.0
• Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets, enable-record-use, enable-swift-package-manager,
omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migration
[✓] Android toolchain - develop for Android devices (Android SDK version 37.0.0) [561ms]
• Android SDK at /home/tibo/Android/Sdk
• Emulator version 37.2.13.0 (build_id 16740729) (CL:N/A)
• Platform android-37.0, build-tools 37.0.0
! Multiple adb binaries found. This can cause conflicts and device detection issues:
- /home/tibo/Android/Sdk/platform-tools/adb
- /usr/lib/android-sdk/platform-tools/adb
• Java binary at: /home/tibo/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 25.0.4+-16339643-b508.27)
• All Android licenses accepted.
[✓] Chrome - develop for the web [15ms]
• Chrome at google-chrome
[✓] Linux toolchain - develop for Linux desktop [891ms]
• Ubuntu clang version 21.1.8 (6ubuntu1)
• cmake version 4.2.3
• ninja version 1.13.2
• pkg-config version 2.5.1
• OpenGL core renderer: AMD Radeon Graphics (radeonsi, renoir, ACO, DRM 3.64, 7.0.0-43-generic)
• OpenGL core version: 4.6 (Core Profile) Mesa 26.0.8-1ubuntu0.3
• OpenGL core shading language version: 4.60
• OpenGL ES renderer: AMD Radeon Graphics (radeonsi, renoir, ACO, DRM 3.64, 7.0.0-43-generic)
• OpenGL ES version: OpenGL ES 3.2 Mesa 26.0.8-1ubuntu0.3
• OpenGL ES shading language version: OpenGL ES GLSL ES 3.20
• GL_EXT_framebuffer_blit: yes
• GL_EXT_texture_format_BGRA8888: yes
[✓] Connected device (3 available) [649ms]
• XQ DE72 (mobile) • 192.168.0.162:40291 • android-arm64 • Android 15 (API 35)
• Linux (desktop) • linux • linux-x64 • Ubuntu 26.04.1 LTS 7.0.0-43-generic
• Chrome (web) • chrome • web-javascript • Google Chrome 141.0.7390.107
[✓] Network resources [343ms]
• All expected network resources are available.
• No issues found!Metadata
Metadata
Assignees
Labels
c: regressionIt was better in the past than it is nowfound in release: 3.50Found to occur in 3.50has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyt: gradle"flutter build" and "flutter run" on Androidteam-androidOwned by Android platform teamtoolAffects the "flutter" command-line tool. See also t: labels.
Activity
puneetkukreja98 commentedon Nov 12, 2026
@deckerst Thanks for reporting the issue. I was able to reproduce it on the latest stable version—this is a regression. I am routing it to the Android team now. A similar issue occurred previously, where it was concluded that this is not related to shared_preferences.
Console logs- 3.47.9
Console logs- 3.50.0
puneetkukreja98 commentedon Nov 12, 2026
flutter doctor -v:
reidbaker-agent commentedon Nov 16, 2026
Thanks for the clear repro. I reproduced this on 3.50.0. 3.47.9 builds fine.
Cause: in 3.50, the Flutter Gradle Plugin copies each app build type that a plugin doesn't define (here
profile) onto that plugin with AGP'sinitWith.initWithalso copiesapplicationIdSuffix, and AGP doesn't allow that in library modules. The same thing happens withisShrinkResources,buildConfigFieldandresValueon a build type. The fix is in #196692.Workarounds until the fix ships. I tested both on 3.50.0: debug and profile builds succeed, and the profile APK has the
.profilepackage name.Set the suffix with the variant API instead of on the build type. In
android/app/build.gradle.kts, removeapplicationIdSuffixfrom theprofileblock (you can keepversionNameSuffix), and add:androidComponents { onVariants(selector().withBuildType("profile")) { variant -> variant.applicationId.set(variant.applicationId.get() + ".profile") } }Give each plugin its own
profilebuild type, so Flutter doesn't copy the app's one. Add this at the end ofandroid/build.gradle.kts:subprojects { pluginManager.withPlugin("com.android.library") { extensions.configure<com.android.build.api.dsl.LibraryExtension>("android") { buildTypes.maybeCreate("profile") } } }[flutter_tools] Do not copy app-only build type properties onto libra…
[stable] [flutter_tools] Do not copy app-only build type properties o…
[beta] [flutter_tools] Do not copy app-only build type properties ont…
[stable] [flutter_tools] Do not copy app-only build type properties o…