React-native-onesignal: CocoaPods could not find compatible versions for pod "OneSignal"

Created on 21 Dec 2018  ·  4Comments  ·  Source: OneSignal/react-native-onesignal

Description:

In android the integration was successful. however in iOS after adding below line in podfile
pod 'react-native-onesignal',
:path => "../node_modules/react-native-onesignal/react-native-onesignal.podspec",
:inhibit_warnings => true

I am getting this error after pod install
[!] CocoaPods could not find compatible versions for pod "OneSignal":
In Podfile:
react-native-onesignal (from ../node_modules/react-native-onesignal/react-native-onesignal.podspec) was resolved to 3.2.12, which depends on
OneSignal (= 2.9.4)

None of your spec sources contain a spec satisfying the dependency: OneSignal (= 2.9.4).

Environment

  • "react-native-onesignal": "^3.2.12"
  • added it using npm and linking it with cocoapods
  • Steps to Reproduce Issue:

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

    1. add this line to pod file
      pod 'react-native-onesignal',
      :path => "../node_modules/react-native-onesignal/react-native-onesignal.podspec",
      :inhibit_warnings => true
    2. run 'pod install'

    Anything else:

    (crash stacktraces, as well as any other information here)

    Most helpful comment

    @cfmitrah Please try to cd into the /ios directory and run pod repo update.

    If that does not work, please post your Podfile

    All 4 comments

    @cfmitrah Please try to cd into the /ios directory and run pod repo update.

    If that does not work, please post your Podfile

    Closing due to no response

    @Nightsd01 ,

    I am getting this error:

    [!] 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.
    

    When I run the following commands in 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

    Is this too aggressive? Do I not need to run rm Podfile.lock && pod deintegrate? Would pod install be sufficient for a CI build tool configuration?

    Was this page helpful?
    0 / 5 - 0 ratings

    Related issues

    tavriaforever picture tavriaforever  ·  36Comments

    diego-paired picture diego-paired  ·  28Comments

    avin3sh picture avin3sh  ·  36Comments

    DaniloCouto picture DaniloCouto  ·  37Comments

    indapublic picture indapublic  ·  43Comments