找不到ReactNativePermissions pod规范

时间:2019-12-21 19:31:28

标签: ios xcode react-native cocoapods

因此,我试图运行以react-native编写的iOS应用项目,在克隆和npm安装之后,尝试在iOS文件夹中进行pod安装时遇到问题。

这是错误:

[!]在ReactNativePermissions中找不到../node_modules/react-native-permissions的podspec

由于:

pod'ReactNativePermissions',:path =>'../ node_modules / react-native-permissions'

我尝试搜索,但找不到任何可行的解决方案,有人可以帮助我吗?

本机版本:2.0.1 React-native-permission:版本2.0.8

6 个答案:

答案 0 :(得分:1)

另一个更新
文档已更新至3.0.0 +

请参阅https://github.com/zoontek/react-native-permissions/issues/547#issuecomment-735216465

更新

我再次遇到这个问题,我注意到yarn添加了react-native-permissions安装的3.0.0-beta.2版本,该版本在permissions_path中没有podspec。我更新了package.json,以解决最新的2+版本(当时为2.2.2)。

enter image description here

高级

:path应该使用双引号而不是单引号。

例如

pod 'Permission-Camera', :path => '#{permissions_path}/Camera.podspec'

应该是

pod 'Permission-Camera', :path => "#{permissions_path}/Camera.podspec"

答案 1 :(得分:1)

将yourProject定位为目标

  permissions_path = '../node_modules/react-native-permissions/ios'
  pod 'Permission-Camera', :path => "#{permissions_path}/Camera/Permission-Camera.podspec"

答案 2 :(得分:1)

You can the difference with the latest path, they moved pod files into respective modules, hence below changes are required 您可以与最新路径不同,他们将 pod 文件移动到相应的模块中,因此需要进行以下更改

答案 3 :(得分:0)

首先将其添加到您的pod文件依赖项位置:

target 'Bverify' do
  # Pods for your project name

........

permissions_path = '../node_modules/react-native-permissions/ios'
  pod 'Permission-Camera', :path => "#{permissions_path}/Camera.podspec"
  pod 'Permission-MediaLibrary', :path => "#{permissions_path}/MediaLibrary.podspec"
  pod 'Permission-PhotoLibrary', :path => "#{permissions_path}/PhotoLibrary.podspec"

.......

您需要在Pod安装之前安装权限:

运行命令:

npm i react-native-permissions

,然后在末尾:

cd ios 吊舱安装

答案 4 :(得分:0)

对我来说,问题出在路径上。我将路径更改为:

pod 'Permission-Camera', :path => "#{permissions_path}/Camera/Permission-Camera.podspec"

然后它起作用了。

答案 5 :(得分:0)

我的问题是目标没有 .podspec`

我有

pod 'Permission-Calendars', :path => "#{permissions_path}/Calendars"

代替

pod 'Permission-Calendars', :path => "#{permissions_path}/Calendars.podspec"