Português: Olá pessoal, estou com um problema quando vou buildar meu app no Package native do Ionic, mostra esse erro. Alguém tem alguma solução?
English: Hello everyone, I have a problem when I build my app in Ionic's native package, it shows this error. Does anyone have a solution?
Failed to install 'onesignal-cordova-plugin': Error: pod: Command failed with exit code 31
at ChildProcess.whenDone (/Users/ionic/builds/project-1/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
I had the same problem and fixed it by downgrading the version of
onesignal-cordova-plugin
to 2.1.0:In 2.1.1 they added cocoa pods support, so 2.1.0 is just before that addition and should work :) (at least it worked in my case)
I think there is a problem with cocoa pods in ionic cloud because I had the same issue when building locally (got fixed after updating pod). This workaround is useful until they fix it.
I found helpful official post about this issue. These tips works like a charm :). No errors and builded successfully.
update_pods.sh
run_pods.sh
Reference the scripts in the ios platform element of config.xml
These command will run just before and after adding the ios platform. The first updates the pod repos and the second verifies that all pods are installed after the platform is added.
Remember to add execute permissions to these bash files. If you see Error: spawn EACCES message, its exactly about permissions.
See detail from this post: https://ionic.zendesk.com/hc/en-us/articles/360001581893-iOS-build-fails-to-fetch-onesignal-cordova-plugin