You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Android build fails under AGP 9 when analytics-kotlin is also in the dependency graph: duplicate namespace 'com.segment.analytics' #214
The plugin's Android module declares namespace 'com.segment.analytics' — the same namespace as Segment's native Android SDK (com.segment.analytics.kotlin:android, whose AAR manifest declares package="com.segment.analytics"). AGP 9 treats duplicate namespaces as a hard manifest-merger error, so any app that has both in its dependency graph no longer builds. This happens in practice with SDKs that embed analytics-kotlin, e.g. the Customer.io SDK (customer_io → io.customer.android:datapipelines → com.segment.analytics.kotlin:android).
Steps to reproduce
Flutter app with segment_analytics: 1.1.12 and AGP 9.x (tested with 9.1.0).
Add the native SDK to android/app/build.gradle (or any dependency that pulls it in, e.g. customer_io):
[:segment_analytics] .../merged_manifest/debug/processDebugManifest/AndroidManifest.xml Error:
Namespace 'com.segment.analytics' is used in multiple modules and/or libraries: :segment_analytics, com.segment.analytics.kotlin:android:1.24.1. Please ensure that all modules and libraries have a unique namespace.
Execution failed for task ':app:processDebugMainManifest'.
> Manifest merger failed with multiple errors, see logs
Fix
Rename the plugin's namespace to something unique, e.g. com.segment.analytics.flutter, and drop the deprecated package= attribute from AndroidManifest.xml. The namespace only affects the generated R/BuildConfig package, not the Dart API or Kotlin source packages. We've been running this patch in production: cheddar-me@dda9906
Activity
fix(android): use a unique namespace to avoid collision with analytic…