Permission is null issue in android 12
Description
Hello team,
According to android api leavel 31 I have updated code. before I am trying to enable bluetooth using PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION). for android 12 I have tried with multiple request like this const granted = await PermissionsAndroid.requestMultiple([ PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION, PermissionsAndroid.PERMISSIONS.BLUETOOTH_SCAN, PermissionsAndroid.PERMISSIONS.BLUETOOTH_CONNECT]);.
I am getting error on only on android 12
React Native Version
0.64.2
Output of npx react-native info
info Fetching system and libraries information... System: OS: macOS 13.4 CPU: (8) arm64 Apple M2 Memory: 39.41 MB / 8.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 20.1.0 - /opt/homebrew/bin/node Yarn: Not Found npm: 8.19.4 - ~/Desktop/Ravindra/All_apps/My_player_perks/node_modules/.bin/npm Watchman: 2023.03.20.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.12.1 - /Users/macmini/.rvm/rubies/ruby-2.7.6/bin/pod SDKs: iOS SDK: Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4 Android SDK: API Levels: 23, 27, 28, 29, 30, 31, 33, 33 Build Tools: 29.0.2, 29.0.3, 30.0.2, 30.0.3, 31.0.0, 33.0.2 System Images: android-31 | Google APIs ARM 64 v8a Android NDK: Not Found IDEs: Android Studio: 2022.1 AI-221.6008.13.2211.9619390 Xcode: 14.3/14E222b - /usr/bin/xcodebuild Languages: Java: 11.0.17 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.1 => 17.0.1 react-native: 0.64.2 => 0.64.2 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
Steps to reproduce
add bluetooth permission in android manifest file and try BleManager.enableBluetooth() it throws error on andorid 12 only
Snack, code example, screenshot, or link to a repository
Error is :
Code :
Old code that not compatible with android 12
Old AndroidManifest.xml
Android/build.gradle
Versions :
After I updating this code for android 12 I got Permission is null Error
Updated AndroidManifest.xml
please let me know what I am missing, what i need to update or upgrade
| :warning: | Unsupported Version of React Native |
|---|---|
| :information_source: | It looks like your issue or the example you provided uses an unsupported version of React Native. Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please upgrade to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on StackOverflow to get further community support. |
This issue is waiting for author's feedback since 24 days. Please provide the requested feedback or this will be closed in 7 days.
This issue was closed because it has been stalled for 7 days with no activity.
This issue was closed because the author hasn't provided the requested feedback after 7 days.
This issue still persists on react-native 0.64.2, when trying to check PermissionsAndroid.PERMISSIONS.READ_MEDIA_IMAGES and PermissionsAndroid.PERMISSIONS.READ_MEDIA_VIDEO
This issue happens because the permission you are trying to check/request doesn't exist on your react native version.
- You can upgrade your react native, or
- use react-native-permissions instead.