Package native binaries Failed to install 'onesignal-cordova-plugin'

╄→гoц情女王★ 提交于 2019-12-11 17:42:26

问题


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

回答1:


I had the same problem and fixed it by downgrading the version of onesignal-cordova-plugin to 2.1.0:

ionic cordova plugin remove onesignal-cordova-plugin
ionic cordova plugin add onesignal-cordova-plugin@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.




回答2:


I found helpful official post about this issue. These tips works like a charm :). No errors and builded successfully.

When an update is released for the OneSignal plugin it is often necessary to update the cocoapods spec repos. This can be accomplished with simple cordova hook scripts. Create the following scripts in the root of your project repo. Be sure to set execute permissions on both scripts using chmod or git.

update_pods.sh

#!/bin/bash
pod repo update

run_pods.sh

#!/bin/bash
pod install --project-directory='./platforms/ios/'

Reference the scripts in the ios platform element of config.xml

<platform name="ios">
<hook src="update_pods.sh" type="before_platform_add" />
<hook src="run_pods.sh" type="after_platform_add" />
...

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



来源:https://stackoverflow.com/questions/49016829/package-native-binaries-failed-to-install-onesignal-cordova-plugin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!