Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ReactNativePermissions pod spec not found

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.

like image 657
Key Avatar asked Dec 21 '19 19:12

Key


4 Answers

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.

like image 53
Tùng Lê Avatar answered Nov 13 '22 01:11

Tùng Lê


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.

enter image description here

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"

like image 9
Dylan w Avatar answered Nov 13 '22 01:11

Dylan w


target yourProject do:

  permissions_path = '../node_modules/react-native-permissions/ios'
  pod 'Permission-Camera', :path => "#{permissions_path}/Camera/Permission-Camera.podspec"
like image 6
Peanut Shi Avatar answered Nov 13 '22 00:11

Peanut Shi


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"
like image 3
Daniel Sun Yang Avatar answered Nov 13 '22 02:11

Daniel Sun Yang