So I'm trying to run an iOS app project that is written in react-native, after cloning and npm install, I encountered a problem while trying to pod install in iOS folder.
This is the error:
[!] No podspec found for ReactNativePermissions
in ../node_modules/react-native-permissions
due to:
pod 'ReactNativePermissions', :path => '../node_modules/react-native-permissions'
I tried to search but couldn't find any working solution, can anyone help me with this?
React-native version: 2.0.1 React-native-permission: version 2.0.8
So this was actually the problem. One of the thing I realised is that, people usually do something like "npm install library" but didn't specify the version. What happens is that it becomes "^version" in the package.json and later on after years, when I run npm install, I get the newer versions and it's not compatible so be sure to check your version guys.
Update:
For react-native-permissions v3.0.1^, the paths got changed to #{permissions_path}/<ModuleName>/Permission-<ModuleName>.podspec
For the exact path, try (from project root):
cd node_modules/react-native-permissions/ios/
You'll get all available module names, cd <ModuleName>
and your '.podspec' file should be there.
For me, the problem is from the path. I changed the path to:
pod 'Permission-Camera', :path => "#{permissions_path}/Camera/Permission-Camera.podspec"
then it worked.
Another update
Documentation has been updated for 3.0.0+
Refer to https://github.com/zoontek/react-native-permissions/issues/547#issuecomment-735216465
Update
I ran into this issue again, I noticed yarn add react-native-permissions
installed 3.0.0-beta.2 version, which doesn't have the podspecs within the permissions_path
. I updated package.json to have latest 2+ version (2.2.2 at the time) to resolve.
Prior
The :path should have double quotes not single.
For example
pod 'Permission-Camera', :path => '#{permissions_path}/Camera.podspec'
Should be
pod 'Permission-Camera', :path => "#{permissions_path}/Camera.podspec"
target yourProject do:
permissions_path = '../node_modules/react-native-permissions/ios'
pod 'Permission-Camera', :path => "#{permissions_path}/Camera/Permission-Camera.podspec"
My problem was that the target didn't have the .podspec`
I had
pod 'Permission-Calendars', :path => "#{permissions_path}/Calendars"
instead of
pod 'Permission-Calendars', :path => "#{permissions_path}/Calendars.podspec"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With