zoontek / react-native-permissions

An unified permissions API for React Native on iOS, Android and Windows.
MIT License
4.1k stars 836 forks source link

[IOS] react-native-permissions: NativeModule.RNPermissions is null #757

Closed perryhoang2012 closed 1 year ago

perryhoang2012 commented 1 year ago

Bug summary

Error: react-native-permissions: NativeModule.RNPermissions is null. To fix this issue try these steps: • If you are using CocoaPods on iOS, run pod install in the ios directory and then clean, rebuild and re-run the app. You may also need to re-open Xcode to get the new pods. • If you are getting this error while unit testing you need to mock the native module. You can use this to get started: https://github.com/react-native-community/react-native-permissions/blob/master/mock.js If none of these fix the issue, please open an issue on the Github repository: https://github.com/react-native-community/react-native-permissions.

I try pod install and re-run but it not working.

Library version

3.6.1

Environment info

"react": "17.0.1",
"react-native": "0.64.0",
"react-native-permissions": "^3.6.1",

Steps to reproduce

  1. pod install
  2. run by X Code

Reproducible sample code

permissions_path = '../node_modules/react-native-permissions/ios'

 pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
 pod 'Permission-BluetoothPeripheral', :path => "#{permissions_path}/BluetoothPeripheral"
 pod 'Permission-MediaLibrary', :path => "#{permissions_path}/MediaLibrary"
 pod 'Permission-PhotoLibrary', :path => "#{permissions_path}/PhotoLibrary"
luan-nvg commented 1 year ago

I have this error on android help

"react-native": "0.68.5", "react": "17.0.2", "react-native-permissions": "^3.8.0",

Captura de tela de 2023-03-16 02-35-17

luan-nvg commented 1 year ago

I managed to solve it by dowgrading to version 3.3.1

Captura de tela de 2023-03-16 03-28-10

perryhoang2012 commented 1 year ago

I managed to solve it by dowgrading to version 3.3.1

Captura de tela de 2023-03-16 03-28-10

It is work. Thanks you.

niyoh55 commented 1 year ago

Locking the version / removing the ^ worked for me. Currently using 3.6.1.

"react-native-permissions" : "3.6.1"

zoontek commented 1 year ago

Duplicate https://github.com/zoontek/react-native-permissions/issues?q=is%3Aissue+RNPermissions+is+null

elgambet commented 1 year ago

I managed to solve it by dowgrading to version 3.3.1

Captura de tela de 2023-03-16 03-28-10

This worked for me too, thanks!

zoontek commented 1 year ago

@niyoh55 @elgambet This is terrible "solutions".

There's no issue in latest versions, just don't forget to clean your build cache and follow the documentation.