React-native-onesignal: CocoaPods 找不到 pod“OneSignal”的兼容版本

创建于 2018-12-21  ·  4评论  ·  资料来源: OneSignal/react-native-onesignal

描述:

在android中集成成功。 但是在 podfile 中添加以下行后在 iOS 中
pod 'react-native-onesignal',
:path => "../node_modules/react-native-onesignal/react-native-onesignal.podspec",
:inhibit_warnings => 真

安装 pod 后出现此错误
[!] CocoaPods 找不到 pod "OneSignal" 的兼容版本:
在 Podfile 中:
react-native-onesignal(来自../node_modules/react-native-onesignal/react-native-onesignal.podspec )已解析为 3.2.12,这取决于
OneSignal (= 2.9.4)

您的规范来源都不包含满足依赖项的规范: OneSignal (= 2.9.4)

环境

  • "react-native-onesignal": "^3.2.12"
  • 使用 npm 添加它并将其与 cocoapods 链接
  • 重现问题的步骤:

    1.npm install --save react-native-onesignal

    1. 将此行添加到 pod 文件
      pod 'react-native-onesignal',
      :path => "../node_modules/react-native-onesignal/react-native-onesignal.podspec",
      :inhibit_warnings => 真
    2. 运行“吊舱安装”

    还要别的吗:

    (崩溃堆栈跟踪,以及此处的任何其他信息)

    最有用的评论

    @cfmitrah请尝试将cd放入/ios目录并运行pod repo update

    如果这不起作用,请发布您的 Podfile

    所有4条评论

    @cfmitrah请尝试将cd放入/ios目录并运行pod repo update

    如果这不起作用,请发布您的 Podfile

    因无响应关闭

    对于任何同行的旅客,
    -->> https://github.com/OneSignal/OneSignal-Flutter-SDK/issues/55#issuecomment -459369818

    @Nightsd01

    我收到此错误:

    [!] CocoaPods could not find compatible versions for pod "OneSignal":
     In Podfile:
     react-native-onesignal (from `../node_modules/react-native-onesignal`) was resolved to 3.4.2, which depends on
     OneSignal (= 2.11.2)
    
    /bin/bash failed with return code: 31
    return code: 1
    None of your spec sources contain a spec satisfying the dependency: `OneSignal (= 2.11.2)`.
    
    You have either:
     * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
     * mistyped the name or version.
     * not added the source repo that hosts the Podspec to your Podfile.
    
    Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default.
    

    当我在 Azure DevOps 中运行以下命令时:

    cd ios && rm Podfile.lock && pod deintegrate && cd .. && rm -rf node_modules && rm package-lock.json && npm install && cd ios/ && pod install && pod repo update

    这是不是太激进了? 我不需要运行rm Podfile.lock && pod deintegrate吗? pod install是否足以用于 CI 构建工具配置?

    此页面是否有帮助?
    0 / 5 - 0 等级