Cordova and PhoneGap initialization failed on Sencha Command

时光怂恿深爱的人放手 提交于 2019-12-24 03:38:11

问题


I had installed PhoneGap through NodeJS CLI on my Ubuntu 13.10 and started native build process. However, during the initialization, this was the executed command and the respective output.

    $ sencha phonegap init com.foo.barapp BarApp
    Sencha Cmd v4.0.2.67
    [INF] 
    [INF] sencha-phonegap-init:
    [INF] 
    [INF] init-phonegap:
    [INF]      [echo] Adding PhoneGap to Application
    [INF]      [echo] Adding PhoneGap template files
    [INF]      [echo] Adding Native properties
    [INF] [x-property-file] Updating property file: /tmp/BarApp/.sencha/app/native.properties
    [INF] [x-property-file] Updating property file: /tmp/BarApp/.sencha/app/build.properties
    [INF]      [echo] Patching build.xml for PhoneGap Support
    [INF]      [echo] Building PhoneGap App
    [ERR] The following error occurred while executing this line:
    /opt/sencha/cmd/4.0.2.67/extensions/cmd-phonegap-packager/cmd-phonegap-packager.plugin.xml:131: The following error occurred while executing this line:
    jar:file:/opt/sencha/cmd/4.0.2.67/sencha.jar!/com/sencha/ant/antlib.xml:608: shellscript returned: 1

This same issued happened to Cordova.


回答1:


The solution I found was redefine the env value set in phonegap.js:

    $ git diff phonegap.js

    $ diff --git a/lib/node_modules/phonegap/bin/phonegap.js b/lib/node_modules/phonegap/bin/phonegap.js
    index b6e469b..e1eb83f 100755
    --- a/lib/node_modules/phonegap/bin/phonegap.js
    +++ b/lib/node_modules/phonegap/bin/phonegap.js
    @@ -1,4 +1,4 @@
    -#!/usr/bin/env node
    +#!/usr/bin/env nodejs

    /*!
     * Module dependencies.eplace the interpreted value set at phonegap.js file.

The same can be done to Cordova script.




回答2:


This helped me with Cordova on Ubuntu 13.10. To fix cordova (on global installment) just edit following file: /usr/local/lib/node_modules/cordova/bin/cordova

-#!/usr/bin/env node
+#!/usr/bin/env nodejs


来源:https://stackoverflow.com/questions/22272569/cordova-and-phonegap-initialization-failed-on-sencha-command

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