IONIC Package Failed to install 'onesignal-cordova-plugin': Error: pod: Command failed with exit code 31

I’m trying to use ionic pro packaging (https://ionicframework.com/pro/package). When building to android everything works fine. But building to IOS gives me this error:

Looking for related GitHub issues on fastlane/fastlane…

\e[91mFailed to upload ipa to storage please retry your build.\e[0m
MAC Iteration 1
MAC verified OK
PKCS7 Encrypted data: pbeWithSHA1And40BitRC2-CBC, Iteration 2048
Certificate bag
PKCS7 Data
Shrouded Keybag: pbeWithSHA1And3-KeyTripleDES-CBC, Iteration 2048
/Users/ionic/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/fastlane-2.75.1/fastlane_core/lib/fastlane_core/ui/interface.rb:145:in `shell_error!’: [!] Exit status of command ‘cordova platform add ios --nofetch’ was 1 instead of 0. (FastlaneCore::Interface::FastlaneShellError)
Adding ios project…
Creating Cordova project for the iOS platform:
Path: platforms/ios
Package: com.notified.x
Name: Notified
iOS project created with cordova-ios@4.5.4
Discovered plugin “cordova-plugin-whitelist” in config.xml. Adding it to the project
Fetching plugin “cordova-plugin-whitelist@^1.3.3” via npm
Installing “cordova-plugin-whitelist” for ios
Adding cordova-plugin-whitelist to package.json
Saved plugin info for “cordova-plugin-whitelist” to config.xml
Discovered plugin “cordova-plugin-device” in config.xml. Adding it to the project
Fetching plugin “cordova-plugin-device@^2.0.2” via npm
Installing “cordova-plugin-device” for ios
Adding cordova-plugin-device to package.json
Saved plugin info for “cordova-plugin-device” to config.xml
Discovered plugin “cordova-plugin-splashscreen” in config.xml. Adding it to the project
Fetching plugin “cordova-plugin-splashscreen@^5.0.2” via npm
Installing “cordova-plugin-splashscreen” for ios
Adding cordova-plugin-splashscreen to package.json
Saved plugin info for “cordova-plugin-splashscreen” to config.xml
Discovered plugin “cordova-plugin-ionic-webview” in config.xml. Adding it to the project
Fetching plugin “cordova-plugin-ionic-webview@^1.2.1” via npm
Installing “cordova-plugin-ionic-webview” for ios
Adding cordova-plugin-ionic-webview to package.json
Saved plugin info for “cordova-plugin-ionic-webview” to config.xml
Discovered plugin “cordova-plugin-ionic-keyboard” in config.xml. Adding it to the project
Fetching plugin “cordova-plugin-ionic-keyboard@^2.1.2” via npm
Installing “cordova-plugin-ionic-keyboard” for ios
Adding cordova-plugin-ionic-keyboard to package.json
Saved plugin info for “cordova-plugin-ionic-keyboard” to config.xml
Discovered plugin “cordova-plugin-app-name” in config.xml. Adding it to the project
Fetching plugin “cordova-plugin-app-name@^1.0.4” via npm
Installing “cordova-plugin-app-name” for ios
Adding cordova-plugin-app-name to package.json
Saved plugin info for “cordova-plugin-app-name” to config.xml
Discovered plugin “cordova-plugin-inappbrowser” in config.xml. Adding it to the project
Fetching plugin “cordova-plugin-inappbrowser@^3.0.0” via npm
Installing “cordova-plugin-inappbrowser” for ios
Adding cordova-plugin-inappbrowser to package.json
Saved plugin info for “cordova-plugin-inappbrowser” to config.xml
Discovered plugin “cordova-plugin-statusbar” in config.xml. Adding it to the project
Fetching plugin “cordova-plugin-statusbar@^2.4.2” via npm
Installing “cordova-plugin-statusbar” for ios
Adding cordova-plugin-statusbar to package.json
Saved plugin info for “cordova-plugin-statusbar” to config.xml
Discovered plugin “cordova-plugin-ionic” in config.xml. Adding it to the project
Fetching plugin “cordova-plugin-ionic@^4.1.7” via npm
Installing “cordova-plugin-ionic” for ios
Plugin dependency “cordova-plugin-splashscreen@5.0.2” already fetched, using that version.
Dependent plugin “cordova-plugin-splashscreen” already installed on ios.
Adding cordova-plugin-ionic to package.json
Saved plugin info for “cordova-plugin-ionic” to config.xml
Discovered plugin “cordova-plugin-cocoapod-support” in config.xml. Adding it to the project
Fetching plugin “cordova-plugin-cocoapod-support@^1.5.0” via npm
Installing “cordova-plugin-cocoapod-support” for ios
Adding cordova-plugin-cocoapod-support to package.json
Saved plugin info for “cordova-plugin-cocoapod-support” to config.xml
Discovered plugin “onesignal-cordova-plugin” in config.xml. Adding it to the project
Fetching plugin “onesignal-cordova-plugin@^2.1.0” via npm
Installing “onesignal-cordova-plugin” for ios
Failed to install ‘onesignal-cordova-plugin’: Error: pod: Command failed with exit code 31
at ChildProcess.whenDone (/Users/ionic/builds/TechNotified/notified-mobile-app/platforms/ios/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
Failed to restore plugin “onesignal-cordova-plugin” from config.xml. You might need to try adding it again. Error: Error: pod: Command failed with exit code 31
Searching for new pods
Checking config.xml for pods.
Installing pods
Sit back and relax this could take a while.
Analyzing dependencies
Downloading dependencies
Generating Pods project
Integrating client project

Sending stats

Pod installation complete! There are 0 dependencies from the Podfile and 0 total pods installed.

[!] The Podfile does not contain any dependencies.

Updating ios build to use workspace.
Adding schemes
–save flag or autosave detected
Saving ios@~4.5.4 into config.xml file …

I’ve installed cocoa pods but that didn’t help.
A lot of threads tells me to do this: “Run pod repo update first. I had the same issue and it helped.” but that is only possible on OS X i think?

I have spent almost a day on this thing now. As usual the ionic documentation only says something like “Click the build button and it’s all done”. https://ionicframework.com/docs/pro/package/

I solved it by doing this steps: https://stackoverflow.com/questions/49016829/package-native-binaries-failed-to-install-onesignal-cordova-plugin then i still got the same error and noticed it said version “^2.1.0” instead of just “2.1.0” on the onesignal-cordova-plugin error line. So i found that it still had the “^” in the version number in both the config.xml and the package.json file. When i removed both it worked!