Onesignal-ios-sdk: CocoaPods could not find compatible versions for pod “OneSignal” when building in Azure DevOps

Created on 4 Oct 2019  Â·  3Comments  Â·  Source: OneSignal/OneSignal-iOS-SDK

I am running Azure DevOps to build a React Native application like so:

    rm -rf node_modules && npm install && cd ios/ && pod install && pod repo update
    [command]/bin/bash /Users/vsts/agent/2.155.1/work/1/s/user_script.sh

    > [email protected] install /Users/vsts/agent/2.155.1/work/1/s/node_modules/fsevents
    > node install

    node-pre-gyp WARN Using request for node-pre-gyp https download 
    [fsevents] Success: "/Users/vsts/agent/2.155.1/work/1/s/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node" is installed via remote

    > @sentry/[email protected] install /Users/vsts/agent/2.155.1/work/1/s/node_modules/@sentry/cli
    > node scripts/install.js


    > [email protected] postinstall /Users/vsts/agent/2.155.1/work/1/s/node_modules/core-js
    > node scripts/postinstall || echo "ignore"

    Thank you for using core-js (‌ https://github.com/zloirock/core-js ‌) for polyfilling JavaScript standard library!‌

    The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: ‌
    >‌ https://opencollective.com/core-js ‌
    >‌ https://www.patreon.com/zloirock ‌

    Also, the author of core-js (‌ https://github.com/zloirock ‌) is looking for a good job -)‌


    > [email protected] postinstall /Users/vsts/agent/2.155.1/work/1/s/node_modules/styled-components
    > node ./scripts/postinstall.js || exit 0

    Use styled-components at work? Consider supporting our development efforts at https://opencollective.com/styled-components
    added 1453 packages from 740 contributors and audited 1020561 packages in 42.721s
    found 4 vulnerabilities (2 low, 2 high)
      run `npm audit fix` to fix them, or `npm audit` for details
    [!] The version of CocoaPods used to generate the lockfile (1.8.1) is higher than the version of the current executable (1.7.5). Incompatibility issues may arise.
    Detected React Native module pods for RNCAsyncStorage, RNGestureHandler, RNReanimated, RNSVG, RNVectorIcons, ReactNativeKeyboardManager, SentryReactNative, appcenter, appcenter-analytics, appcenter-crashes, react-native-calendar-events, react-native-onesignal, react-native-splash-screen, and react-native-webview
    Analyzing dependencies

The Podfile looks like so:

    platform :ios, '9.0'
    require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

    abstract_target 'defaults' do
      # Pods for NFIBEngage
      pod 'React', :path => '../node_modules/react-native/'
      pod 'React-Core', :path => '../node_modules/react-native/React'
      pod 'React-DevSupport', :path => '../node_modules/react-native/React'
      pod 'React-fishhook', :path => '../node_modules/react-native/Libraries/fishhook'
      pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
      pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
      pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
      pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
      pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
      pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
      pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
      pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
      pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
      pod 'React-RCTWebSocket', :path => '../node_modules/react-native/Libraries/WebSocket'

      pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
      pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
      pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
      pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
      pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

      pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
      pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
      pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

      pod 'RNDeviceInfo', :path => '../node_modules/react-native-device-info'

      target 'NFIBEngage'
      target 'PROD'
      target 'DEV'
      target 'QA'
      target 'UA'
      target 'INT'

      use_native_modules!

    end

and a partial listing of the Podfile.lock file:

    PODS:
      - appcenter (2.3.0):
        - AppCenterReactNativeShared
        - React
      - appcenter-analytics (2.3.0):
        - AppCenter/Analytics
        - AppCenterReactNativeShared
        - React
      - appcenter-crashes (2.3.0):
        - AppCenter/Crashes (= 2.3.0)
        - AppCenterReactNativeShared
        - React
      - AppCenter/Analytics (2.3.0):
        - AppCenter/Core
      - AppCenter/Core (2.3.0)
      - AppCenter/Crashes (2.3.0):
        - AppCenter/Core
      - AppCenterReactNativeShared (2.3.0):
        - AppCenter/Core (= 2.3.0)
      - boost-for-react-native (1.63.0)
      - DoubleConversion (1.1.6)
      - Folly (2018.10.22.00):
        - boost-for-react-native
        - DoubleConversion
        - Folly/Default (= 2018.10.22.00)
        - glog
      - Folly/Default (2018.10.22.00):
        - boost-for-react-native
        - DoubleConversion
        - glog
      - glog (0.3.5)
      - IQKeyboardManager (4.0.13)
      - OneSignal (2.11.2)
      - React (0.60.4):
        - React-Core (= 0.60.4)
        - React-DevSupport (= 0.60.4)
        - React-RCTActionSheet (= 0.60.4)
        - React-RCTAnimation (= 0.60.4)
        - React-RCTBlob (= 0.60.4)
        - React-RCTImage (= 0.60.4)
        - React-RCTLinking (= 0.60.4)
        - React-RCTNetwork (= 0.60.4)
        - React-RCTSettings (= 0.60.4)
        - React-RCTText (= 0.60.4)
        - React-RCTVibration (= 0.60.4)
        - React-RCTWebSocket (= 0.60.4)
      - React-Core (0.60.4):
        - Folly (= 2018.10.22.00)
        - React-cxxreact (= 0.60.4)
        - React-jsiexecutor (= 0.60.4)
        - yoga (= 0.60.4.React)
      - React-cxxreact (0.60.4):
        - boost-for-react-native (= 1.63.0)
        - DoubleConversion
        - Folly (= 2018.10.22.00)
        - glog
        - React-jsinspector (= 0.60.4)
      - React-DevSupport (0.60.4):
        - React-Core (= 0.60.4)
        - React-RCTWebSocket (= 0.60.4)
      - React-fishhook (0.60.4)
      - React-jsi (0.60.4):
        - boost-for-react-native (= 1.63.0)
        - DoubleConversion
        - Folly (= 2018.10.22.00)
        - glog
        - React-jsi/Default (= 0.60.4)
      - React-jsi/Default (0.60.4):
        - boost-for-react-native (= 1.63.0)
        - DoubleConversion
        - Folly (= 2018.10.22.00)
        - glog
      - React-jsiexecutor (0.60.4):
        - DoubleConversion
        - Folly (= 2018.10.22.00)
        - glog
        - React-cxxreact (= 0.60.4)
        - React-jsi (= 0.60.4)
      - React-jsinspector (0.60.4)
      - react-native-calendar-events (1.7.3):
        - React
      - react-native-onesignal (3.4.2):
        - OneSignal (= 2.11.2)
        - React (< 1.0.0, >= 0.13.0)
      - react-native-splash-screen (3.2.0):
        - React

The error I get is:

[!] CocoaPods could not find compatible versions for pod "OneSignal":
      In snapshot (Podfile.lock):
        OneSignal (= 2.11.2)
    /bin/bash failed with return code: 31

      In Podfile:
    return code: 1
        react-native-onesignal (from `../node_modules/react-native-onesignal`) was resolved to 3.4.2, which depends on
          OneSignal (= 2.11.2)

    None of your spec sources contain a spec satisfying the dependencies: `OneSignal (= 2.11.2), 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.

What could be the reason I continue to get this error message?

I have tried removing rm -rf package-lock.json and rm Podfile.lock, but that is not working.

I ran npm uninstall react-native-onesignal && npm install react-native-onesignal then did rm -rf node_modules && cd ios/ && rm Podfile.lock && pod deintegrate && cd .. && npm install && cd ios/ && pod install

Most helpful comment

@jeevankumarkanuganti add pod repo update before building project

All 3 comments

@ldco2016 how did you fix it?

how did you fix it?

@jeevankumarkanuganti add pod repo update before building project

Was this page helpful?
0 / 5 - 0 ratings

Related issues

adambolcsfoldi picture adambolcsfoldi  Â·  4Comments

ogres picture ogres  Â·  3Comments

luai-kalkatawi picture luai-kalkatawi  Â·  4Comments

reza-khalafi picture reza-khalafi  Â·  5Comments

halilyuce picture halilyuce  Â·  3Comments