Namespace collision between :core and :models when uniquePackageNames is enabled
Closed this issue · 6 comments
- I have updated Purchases SDK to the latest version
- I have read
the Contribution Guidelines - I have searched the Community
- I have read docs.revenuecat.com
- I have searched
for existing Github issues
Describe the bug
With the release of 1.0.0 the :models
module was added, however, the namespace in it is the same as in :core
module. With the android.uniquePackageNames=true
property this leads to an exception during the compilation of the Android app.
purchases-kmp/models/build.gradle.kts
Line 25 in 7c60a71
> Task :app-android:processDevDebugMainManifest FAILED
[com.revenuecat.purchases:purchases-kmp-core-android:1.0.0+13.2.0] /Users/alexey/.gradle/caches/8.8/transforms/61696659ac84c82bf00d9657d836fdb4/transformed/core-release/AndroidManifest.xml Error:
Namespace 'com.revenuecat.purchases.kmp' is used in multiple modules and/or libraries: com.revenuecat.purchases:purchases-kmp-core-android:1.0.0+13.2.0, com.revenuecat.purchases:purchases-kmp-models-android:1.0.0+13.2.0. 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
/Users/alex/StudioProjects/own/xxx/app-android/src/main/AndroidManifest.xml Error:
Validation failed, exiting
See https://developer.android.com/r/studio-ui/build/manifest-merger for more information about the manifest merger.
The solution is to change the namespace
accordingly to have a module name at the end like in other modules:
purchases-kmp/mappings/build.gradle.kts
Line 35 in 7c60a71
Our temporary fix is to disable android.uniquePackageNames
property in out project.
- Environment
- Platform: Android
- SDK version: 1.0.0
- OS version: macOS
- IDE (e.g. Android Studio, Xcode, Fleet):
- IDE version:
- Device and/or emulator/simulator:
- Device
- Emulator/simulator
- Environment:
- Closed testing / Sandbox
- TestFlight
- Production
- How widespread is the issue. Percentage of devices affected.
- Debug logs that reproduce the issue
Not needed - Steps to reproduce, with a description of expected vs. actual behavior
You need to enableandroid.uniquePackageNames
insidegradle.properties
and build the android app.
TIL about android.uniquePackageNames
, thanks for reporting this! We'll have a look at what the best course of action would be.
All the above PRs have been merged. This should be in the next release.
@alaegin Latest release just went out. I'd be curious to know if it fixes the issue for you, whenever you have some time!
@JayShortway
Fixed the issue for me. I was having issues for the past few days on a new build. This was the last piece of the puzzle.
Hello, @JayShortway!
Problem solved, thank you!
@alaegin @adrianegraphene Great to hear, thanks both for confirming!