Prerequisites
Expected Behavior
Builds for Google Play should pass validation
Current Behavior
Google Play rejects the build with the following error message:
Duplicate declarations of <uses-permission> element 'android.permission.ACCESS_FINE_LOCATION' in manifest with different maxSdkVersions.
Library version
3.5.1
Device
Android SDK 24+
Environment info
System:
OS: Linux 6.8 Ubuntu 24.04.4 LTS 24.04.4 LTS (Noble Numbat)
CPU: (16) x64 Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz
Memory: 35.64 GB / 62.39 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 22.22.0
path: /run/user/1006/fnm_multishells/11146_1779311398441/bin/node
Yarn:
version: 1.22.22
path: /run/user/1006/fnm_multishells/11146_1779311398441/bin/yarn
npm:
version: 10.9.4
path: ~/iotv/lws/m001/Mobile/loRaWANSystemMobile/node_modules/.bin/npm
Watchman:
version: 20260104.093129.0
path: /usr/local/bin/watchman
SDKs:
Android SDK:
API Levels:
- "35"
- "36"
Build Tools:
- 34.0.0
- 35.0.0
- 36.0.0
System Images:
- android-35 | Google APIs Intel x86_64 Atom
- android-36.1 | Google APIs Intel x86_64 Atom
Android NDK: Not Found
IDEs:
Android Studio: Not Found
Languages:
Java:
version: 17.0.19
path: /usr/bin/javac
Ruby: Not Found
npmPackages:
"@react-native-community/cli":
installed: 20.1.2
wanted: 20.1.2
react:
installed: 19.2.3
wanted: 19.2.3
react-native:
installed: 0.84.1
wanted: 0.84.1
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: true
iOS:
hermesEnabled: true
newArchEnabled: false
Steps to reproduce
- Follow README instructions on adding Android permissions to manifest
- Build an APK or AAB for distribution
- Upload to Google Play
- Wait for processing to finish
Formatted code sample or link to a repository
Relevant log output
Additional information
This issue is caused when merging the manifest file of RxAndroidBle.
The manifest has a TODO for adding maxSdkVersion to <uses-permission-sdk-23 />
As this has not been done yet (as of RxAndroidBle 1.19.1), it will cause issues when the host app tries to follow the correct paradigm of using maxSdkVersion
The current workaround solution is to use merge rule makers to inform Gradle how to merge the manifests correctly.
If your app is targeting SDK 23+, it should be safe to remove them entirely:
<uses-permission-sdk-23 android:name="android.permission.ACCESS_FINE_LOCATION" tools:node="remove"/>
<uses-permission-sdk-23 android:name="android.permission.ACCESS_COARSE_LOCATION" tools:node="remove"/>
Alternatively, define them with the max SDK, too:
<uses-permission-sdk-23 android:name="android.permission.ACCESS_COARSE_LOCATION" android:maxSdkVersion="30" />
<uses-permission-sdk-23 android:name="android.permission.ACCESS_FINE_LOCATION" android:maxSdkVersion="30" />
The key insight was provided by this comment
Prerequisites
Expected Behavior
Builds for Google Play should pass validation
Current Behavior
Google Play rejects the build with the following error message:
Duplicate declarations of <uses-permission> element 'android.permission.ACCESS_FINE_LOCATION' in manifest with different maxSdkVersions.Library version
3.5.1
Device
Android SDK 24+
Environment info
System: OS: Linux 6.8 Ubuntu 24.04.4 LTS 24.04.4 LTS (Noble Numbat) CPU: (16) x64 Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz Memory: 35.64 GB / 62.39 GB Shell: version: "5.9" path: /bin/zsh Binaries: Node: version: 22.22.0 path: /run/user/1006/fnm_multishells/11146_1779311398441/bin/node Yarn: version: 1.22.22 path: /run/user/1006/fnm_multishells/11146_1779311398441/bin/yarn npm: version: 10.9.4 path: ~/iotv/lws/m001/Mobile/loRaWANSystemMobile/node_modules/.bin/npm Watchman: version: 20260104.093129.0 path: /usr/local/bin/watchman SDKs: Android SDK: API Levels: - "35" - "36" Build Tools: - 34.0.0 - 35.0.0 - 36.0.0 System Images: - android-35 | Google APIs Intel x86_64 Atom - android-36.1 | Google APIs Intel x86_64 Atom Android NDK: Not Found IDEs: Android Studio: Not Found Languages: Java: version: 17.0.19 path: /usr/bin/javac Ruby: Not Found npmPackages: "@react-native-community/cli": installed: 20.1.2 wanted: 20.1.2 react: installed: 19.2.3 wanted: 19.2.3 react-native: installed: 0.84.1 wanted: 0.84.1 npmGlobalPackages: "*react-native*": Not Found Android: hermesEnabled: true newArchEnabled: true iOS: hermesEnabled: true newArchEnabled: falseSteps to reproduce
Formatted code sample or link to a repository
Relevant log output
Additional information
This issue is caused when merging the manifest file of RxAndroidBle.
The manifest has a TODO for adding
maxSdkVersionto<uses-permission-sdk-23 />As this has not been done yet (as of RxAndroidBle 1.19.1), it will cause issues when the host app tries to follow the correct paradigm of using
maxSdkVersionThe current workaround solution is to use merge rule makers to inform Gradle how to merge the manifests correctly.
If your app is targeting SDK 23+, it should be safe to remove them entirely:
Alternatively, define them with the max SDK, too:
The key insight was provided by this comment