Skip to content

cronetHttpNoPlay=true build broken in Flutter 3.44.0: Namespace 'org.chromium.net' is used in multiple modules and/or libraries #1932

Closed

Description

@dreautall

Hi,

building an apk with --dart-define=cronetHttpNoPlay=true is broken with the new Gradle version in Flutter 3.44.0. Building without that option (so, native cronet) works fine.

Error message: [org.chromium.net:cronet-embedded:141.7340.3] ~/.gradle/caches/9.1.0/transforms/2e5c6e1ae32483156f8fb1f259ac32ce/transformed/cronet-embedded-141.7340.3/AndroidManifest.xml Error: Namespace 'org.chromium.net' is used in multiple modules and/or libraries: org.chromium.net:cronet-embedded:141.7340.3, org.chromium.net:httpengine-native-provider:141.7340.3, org.chromium.net:cronet-common:141.7340.3, org.chromium.net:cronet-api:141.7340.3, org.chromium.net:cronet-shared:141.7340.3. Please ensure that all modules and libraries have a unique namespace. For more information, See https://developer.android.com/studio/build/configure-app-module#set-namespace

Minimal example:

$ flutter create cronetbug
$ cd cronetbug
$ flutter pub add cronet_http
$ flutter build apk --dart-define=cronetHttpNoPlay=true
Minimal example with output on my machine (including the working run without that option)
➜  /tmp $ flutter --version
Flutter 3.44.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 559ffa3f75 (2 weeks ago) • 2026-05-15 14:13:13 -0700
Engine • hash fcf463a2242790d1fdcd9d044f533080f5022e18 (revision 4c525dac5e) (15 days ago) • 2026-05-15 19:00:04.000Z
Tools • Dart 3.12.0 • DevTools 2.57.0
➜  /tmp $ flutter create cronetbug
Creating project cronetbug...
Resolving dependencies in `cronetbug`... 
Downloading packages... 
Got dependencies in `cronetbug`.
Wrote 131 files.

All done!
You can find general documentation for Flutter at: https://docs.flutter.dev/
Detailed API documentation is available at: https://api.flutter.dev/
If you prefer video documentation, consider: https://www.youtube.com/c/flutterdev

In order to run your application, type:

  $ cd cronetbug
  $ flutter run

Your application code is in cronetbug/lib/main.dart.

➜  /tmp $ cd cronetbug 
➜  cronetbug $ flutter pub add cronet_http
Resolving dependencies... 
Downloading packages... 
+ args 2.7.0
+ cronet_http 1.8.0
+ ffi 2.2.0
+ http 1.6.0
+ http_parser 4.1.2
+ http_profile 0.1.0
+ jni 0.15.2 (1.0.0 available)
  matcher 0.12.19 (0.12.20 available)
  meta 1.18.0 (1.18.2 available)
+ package_config 2.2.0
+ plugin_platform_interface 2.1.8
  test_api 0.7.11 (0.7.12 available)
+ typed_data 1.4.0
  vector_math 2.2.0 (2.3.0 available)
+ web 1.1.1
Changed 11 dependencies!
5 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.
➜  cronetbug $ flutter build apk --dart-define=cronetHttpNoPlay=true
Resolving dependencies... 
Downloading packages... 
  jni 0.15.2 (1.0.0 available)
  matcher 0.12.19 (0.12.20 available)
  meta 1.18.0 (1.18.2 available)
  test_api 0.7.11 (0.7.12 available)
  vector_math 2.2.0 (2.3.0 available)
Got dependencies!
5 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.
WARNING: Your app uses the following plugins that apply Kotlin Gradle Plugin (KGP): cronet_http
Future versions of Flutter will fail to build if your app uses plugins that apply KGP.

Please check the changelogs of these plugins and upgrade to a version that supports Built-in Kotlin.
If no such version exists, report the issue to the plugin. If necessary, here is a guide on filing 
an issue against a plugin: https://docs.flutter.dev/release/breaking-changes/migrate-to-built-in-kotlin/for-app-developers#report-incompatible-kotlin-gradle-plugin-usage-to-plugin-authors

If you are a plugin author, please migrate your plugin to Built-in Kotlin using this guide: https://docs.flutter.dev/release/breaking-changes/migrate-to-built-in-kotlin/for-plugin-authors
Font asset "MaterialIcons-Regular.otf" was tree-shaken, reducing it from 1645184 to 1368 bytes (99.9% reduction). Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app.
[org.chromium.net:cronet-embedded:141.7340.3] ~/.gradle/caches/9.1.0/transforms/2e5c6e1ae32483156f8fb1f259ac32ce/transformed/cronet-embedded-141.7340.3/AndroidManifest.xml Error:
        Namespace 'org.chromium.net' is used in multiple modules and/or libraries: org.chromium.net:cronet-embedded:141.7340.3, org.chromium.net:httpengine-native-provider:141.7340.3, org.chromium.net:cronet-common:141.7340.3, org.chromium.net:cronet-api:141.7340.3, org.chromium.net:cronet-shared:141.7340.3. Please ensure that all modules and libraries have a unique namespace. For more information, See https://developer.android.com/studio/build/configure-app-module#set-namespace
/private/tmp/cronetbug/android/app/src/main/AndroidManifest.xml Error:
        Validation failed, exiting

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processReleaseMainManifest'.
> Manifest merger failed with multiple errors, see logs

* 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 generate a Build Scan (Powered by Develocity).
> Get more help at https://help.gradle.org.

BUILD FAILED in 26s
Running Gradle task 'assembleRelease'...                           26.6s
Gradle task assembleRelease failed with exit code 1
➜  cronetbug $ flutter build apk                                    
Resolving dependencies... 
Downloading packages... 
  jni 0.15.2 (1.0.0 available)
  matcher 0.12.19 (0.12.20 available)
  meta 1.18.0 (1.18.2 available)
  test_api 0.7.11 (0.7.12 available)
  vector_math 2.2.0 (2.3.0 available)
Got dependencies!
5 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.
WARNING: Your app uses the following plugins that apply Kotlin Gradle Plugin (KGP): cronet_http
Future versions of Flutter will fail to build if your app uses plugins that apply KGP.

Please check the changelogs of these plugins and upgrade to a version that supports Built-in Kotlin.
If no such version exists, report the issue to the plugin. If necessary, here is a guide on filing 
an issue against a plugin: https://docs.flutter.dev/release/breaking-changes/migrate-to-built-in-kotlin/for-app-developers#report-incompatible-kotlin-gradle-plugin-usage-to-plugin-authors

If you are a plugin author, please migrate your plugin to Built-in Kotlin using this guide: https://docs.flutter.dev/release/breaking-changes/migrate-to-built-in-kotlin/for-plugin-authors
Font asset "MaterialIcons-Regular.otf" was tree-shaken, reducing it from 1645184 to 1368 bytes (99.9% reduction). Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app.
Running Gradle task 'assembleRelease'...                           52.9s
✓ Built build/app/outputs/flutter-apk/app-release.apk (43.9MB)

Any further required information please let me know!

Activity

  1. dreautall commented on May 31, 2026

    @dreautall
    Author

    I tried using the upcoming 1.9.0 version, strangely enough building without Play Services works fine, it now fails on building with play services with the same error message:

    [org.chromium.net:cronet-api:141.7340.3] ~/.gradle/caches/9.1.0/transforms/963c24213ab3058b6aa73c06b12bac66/transformed/cronet-api-141.7340.3/AndroidManifest.xml Error: Namespace 'org.chromium.net' is used in multiple modules and/or libraries: org.chromium.net:cronet-api:141.7340.3, org.chromium.net:cronet-shared:141.7340.3. Please ensure that all modules and libraries have a unique namespace. For more information, See https://developer.android.com/studio/build/configure-app-module#set-namespace

    In pubspec.yaml - flutter clean && flutter pub get was run after the change:

      cronet_http:
        git:
          url: https://github.com/brianquinlan/http.git
          path: pkgs/cronet_http
          ref: cronet_1_9_0
    
  2. brianquinlan commented on Jun 22, 2026

    @brianquinlan
    Collaborator

    It is strange that the latest version doesn't work because the CI tests with the latest flutter version and both the Play and non-Play versions.

  3. carloshenrique-dev commented on Jun 24, 2026

    @carloshenrique-dev

    I added this to my gradle.properties as a temporary workaround to unblock AAB and APK generation:

    android.uniquePackageNames=false
    

    But a proper fix is still needed.

  4. added a commit that references this issue on Jun 27, 2026
  5. brianquinlan commented on Jul 1, 2026

    @brianquinlan
    Collaborator

    This is an upstream bug for this but supposedly, it is fixed:
    https://issues.chromium.org/issues/406926302

    Hmmm, org.chromium.net:cronet-api:141.7340.3 referenced in #1932 (comment) isn't the latest version. Likewise with org.chromium.net:cronet-shared:141.7340.3.

    I wonder why is holding back the use of the most recent version?

  6. brianquinlan commented on Jul 1, 2026

    @brianquinlan
    Collaborator
  7. brianquinlan commented on Jul 2, 2026

    @brianquinlan
    Collaborator

    ...but the lastest (18.1.1) version of play-services-cronet depends on the older version of cronet-api:
    https://mvnrepository.com/artifact/com.google.android.gms/play-services-cronet/18.1.1

  8. downtown1629 commented on Jul 18, 2026

    @downtown1629

    I'm getting the same issue even without cronetHttpNoPlay=true. Is waiting for Google to update play-services-cronet's dependency all we can do? Where should we report it?

  9. brianquinlan commented on Jul 20, 2026

    @brianquinlan
    Collaborator
  10. Mohammad-amleh commented on Sep 22, 2026

    @Mohammad-amleh

    when this issue will be resolved ?

  11. igordanilovski commented on Oct 21, 2026

    @igordanilovski

    Any updates on this guys?

  12. brianquinlan commented on Oct 26, 2026

    @brianquinlan
    Collaborator

    I just released package:cronet_http 1.10.1 that fixes this issue. Please reopen this issue is you still have problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

package:cronet_httptype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions