Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permission conflict error, unable to use location, on expo 47 and SDK 31 #155

Open
Goostavo opened this issue Dec 18, 2022 · 0 comments
Open
Labels
bug Something isn't working

Comments

@Goostavo
Copy link

Summary

The problem:
-> My app location permission is returning on request never_ask_again.
-> I added ACCESS_FINE_LOCATION on app.json file. But the Google Play refuses the App due double implementation.


The cause:
The lib uses uses-permission-sdk-23 and expo uses uses-permission directives. So the config/plugin is doubliing the configuration.

When using the option neverUseForLocation it manually adds the ACCESS_FINE_LOCATION with maxSdk and blocks the location permission on newer devices.

It is added on this file: https://github.com/expo/config-plugins/blob/b86291107ec646aee5aee66362e182ec541caf34/packages/react-native-ble-plx/build/withBLEAndroidManifest.js


Workarounds:

  1. Manually remove the double permissions added by the config plugin.
  2. Remove the neverUseForLocation option.

Config Plugin

@config-plugins/react-native-ble-plx

What platform(s) does this occur on?

Android

SDK Version

47

Reproducible demo

Generated AndroidManifest.xml (Without explicit ACCESS_FINE_LOCATION)

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.qualityhub" xmlns:tools="http://schemas.android.com/tools">
  <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"/>

Generated AndroidManifest.xml (With explict ACCESS_FINE_LOCATION on app.json)

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.qualityhub" xmlns:tools="http://schemas.android.com/tools">
  <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"/>
  <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

App.json plugins session

   "permissions": [
       "ACCESS_COARSE_LOCATION",
       "ACCESS_FINE_LOCATION"
    ],
    "plugins": [
     [
       "@config-plugins/react-native-ble-plx",
       {
         "isBackgroundEnabled": true,
         "neverForLocation": true
       }
     ],
@Goostavo Goostavo added the bug Something isn't working label Dec 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant