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
react-native info output:
System:
OS: macOS 10.15.3
CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Memory: 190.84 MB / 16.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 10.13.0 - /usr/local/bin/node
Yarn: 1.22.0 - /usr/local/bin/yarn
npm: 6.4.1 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
IDEs:
Android Studio: 3.6 AI-192.7142.36.36.6241897
Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.5 => 0.61.5
npmGlobalPackages:
react-native-git-upgrade: 0.2.7
Library version: 2.1.5
jest@hamoudaarfaoui You need to mock the module.
See:
Same issue
@yosukapro this solution solved my issue :
you need to mock react-native-permissions
import mock from 'react-native-permissions/mock';
jest.mock('react-native-permissions', () => {
return mock;
});
I have the same issue, but when running on Android device (or emulator).
Here's my RN info.
System:
OS: macOS 10.15.6
CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
Memory: 533.88 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.14.1 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.13.4 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.3 - /usr/local/bin/pod
SDKs:
iOS SDK: Not Found
Android SDK:
Android NDK: 21.0.6113669
IDEs:
Android Studio: 4.0 AI-193.6911.18.40.6626763
Xcode: /undefined - /usr/bin/xcodebuild
Languages:
Java: 10.0.2 - /usr/bin/javac
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.13.1 => 16.13.1
react-native: ^0.63.2 => 0.63.2
npmGlobalPackages:
react-native: Not Found
Is there something missing or am I obligated to have the iOS SDK config installed as well?
@hamoudaarfaoui this worked for me! Thanks! 🙏
Most helpful comment
@yosukapro this solution solved my issue :
you need to mock
react-native-permissions