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

I encountered an error message stating 'ENOENT: no such file or directory #859

Closed vaidehi-iottive closed 8 months ago

vaidehi-iottive commented 8 months ago

Before submitting a new issue

Bug summary

When attempting to install this version of the node module, I encountered an issue within the module itself. I encountered an error message stating 'ENOENT: no such file or directory' while attempting to access 'RNPermissionsModule.java' in the specified path within the 'react-native-permissions' module. How can I troubleshoot and resolve this issue?

Library version

4.1.1

Environment info

info Fetching system and libraries information... System: OS: macOS 13.6 CPU: (8) x64 Intel(R) Core(TM) i7-1068NG7 CPU @ 2.30GHz Memory: 100.03 MB / 16.00 GB Shell: version: "5.9" path: /bin/zsh Binaries: Node: version: 21.6.2 path: /usr/local/bin/node Yarn: version: 1.22.19 path: /usr/local/bin/yarn npm: version: 10.2.4 path: /usr/local/bin/npm Watchman: version: 2024.01.22.00 path: /usr/local/bin/watchman (node:7140) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead. (Use node --trace-deprecation ... to show where the warning was created) info React Native v0.73.6 is now available (your project is running on v0.71.7).

zoontek commented 8 months ago

@vaidehi-iottive Your environment infos are not correct. Please fix them.

vaidehi-iottive commented 8 months ago

In the directory mobile-native-app/node_modules/react-native-permissions/android/src/oldarch/com/zoontek, you'll find a file named RNPermissionsModule.java. Copy and paste this file into the directory mobile-native-app/node_modules/react-native-permissions/android/src/main/java/com/zoontek. Then, remove the original file from the previous folder and place it in the new folder. After completing these steps, you should be able to run the app successfully.

I found the solution, but currently, I need to perform the task manually. I'm also verifying version 4.1.4.

Screenshot 2024-03-20 at 22 49 08 Screenshot 2024-03-20 at 22 52 58
zoontek commented 8 months ago

@vaidehi-iottive This should not happen with supported versions of react-native, which has been correctly updated (using https://react-native-community.github.io/upgrade-helper)

vaidehi-iottive commented 8 months ago

I have thoroughly explored all possible scenarios, including those outlined in the above guidelines, and have concluded that I do not need to update my app version, even though it is built with React Native version 0.71.7.