Skip to content

🐛 Google Play build rejected for duplicate ACCESS_FINE_LOCATION permission with different max SDK versions #1338

@craiganderson-iotv

Description

@craiganderson-iotv

Prerequisites

  • I checked the documentation and FAQ without finding a solution
  • I checked to make sure that this issue has not already been filed

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

  1. Follow README instructions on adding Android permissions to manifest
  2. Build an APK or AAB for distribution
  3. Upload to Google Play
  4. Wait for processing to finish

Formatted code sample or link to a repository

N/A

Relevant log output

N/A

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions