Skip to content

Namespace conflict in 1.8.1 prevents Android builds with AGP 9.0 #289

@abd3lraouf

Description

@abd3lraouf

PowerSync 1.8.1 has a namespace conflict between its Android AAR modules that prevents successful Android app builds when using Android Gradle Plugin (AGP) 9.0+. The com.powersync:core-android-debug and com.powersync:common-android-debug modules both declare the same namespace com.powersync, which violates AGP 9.0's strict namespace uniqueness requirement.

Environment

  • PowerSync Version: 1.8.1
  • Android Gradle Plugin (AGP): 9.0.0-beta01
  • Gradle: 9.2.0
  • Kotlin: 2.2.21
  • Kotlin Multiplatform: Yes
  • Build Configuration: Kotlin Multiplatform with Android and iOS targets

Steps to Reproduce

  1. Create a Kotlin Multiplatform project with an Android target
  2. Upgrade to AGP 9.0.0-beta01 or later
  3. Add PowerSync dependencies:
    implementation("com.powersync:core:1.8.1")
    implementation("com.powersync:connector-supabase:1.8.1")
  4. Attempt to build the Android app: ./gradlew :app:android:assembleDebug

Expected Behavior

The Android app should build successfully with all PowerSync modules included.

Actual Behavior

Build fails with manifest merger error:

> Task :app:android:processDebugMainManifest FAILED

[com.powersync:core-android-debug:1.8.1] /Users/.../com.powersync/core-android-debug/1.8.1/.../AndroidManifest.xml Error:
	Namespace 'com.powersync' is used in multiple modules and/or libraries:
	  - com.powersync:core-android-debug:1.8.1
	  - com.powersync:common-android-debug:1.8.1

	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

/path/to/app/AndroidManifest.xml Error:
	Validation failed, exiting

FAILURE: Build failed with an exception.

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

repro project: abd3lraouf/PowersyncRepro

Dependency Tree Analysis

Running ./gradlew :app:android:dependencies --configuration debugRuntimeClasspath shows:

+--- com.powersync:core:1.8.1
|    \--- com.powersync:core-android-debug:1.8.1
|         +--- com.powersync:powersync-sqlite-core:0.4.8
|         +--- com.powersync:common:1.8.1
|         |    \--- com.powersync:common-android-debug:1.8.1  // <-- Same namespace

Both core-android-debug and common-android-debug AAR files contain AndroidManifest.xml with:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.powersync">  <!-- Same namespace -->

Root Cause

AGP 9.0 introduced stricter namespace validation as part of the unified plugin architecture. Each Android library module must have a unique namespace. PowerSync's current architecture has:

  • com.powersync:core-android-debug → namespace: com.powersync
  • com.powersync:common-android-debug → namespace: com.powersync

This worked in AGP 8.x but fails in AGP 9.0.

Proposed Solutions

Option 1: Use Module-Specific Namespaces (Recommended)

Update the namespace for each module to be unique:

  • core-android-debugcom.powersync.core
  • common-android-debugcom.powersync.common

Option 2: Consolidate Modules

If the modules don't need separate manifests, consider consolidating them into a single AAR.

Option 3: Use Custom Package Names

Use AGP's namespace DSL to set distinct namespaces:

// In core module's build.gradle.kts
android {
    namespace = "com.powersync.core"
}

// In common module's build.gradle.kts
android {
    namespace = "com.powersync.common"
}

Would Appreciate

  • Confirmation of plans to fix this in an upcoming release
  • Estimated timeline for a fix
  • Any official workarounds while waiting for the fix

Thank you for the excellent library! Looking forward to using it with AGP 9.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions