我有PhoneGap的问题。当我想补充平台,下面的命令得到了错误:
$出口PATH=${PATH}:/ProgramFiles/Android/adt-bundle-linux-x86_64-20140321/sdk/platform-tools:/ProgramFiles/Android/adt-bundle-linux-x86_64-20140321/sdk/tools
$科尔多瓦创建Hello输入com.example.hello的HelloWorld
创建一个新的科尔多瓦项目名的HelloWorld和ID输入com.example.hello的位置/家庭/ matjazmav /你好
$ CD打招呼
/你好$科尔多瓦平台添加的android
创建Android项目...
/home/matjazmav/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:126
扔ê;
^
错误:同时列出Android的目标时出错
在/home/matjazmav/.cordova/lib/android/cordova/3.4.0/bin/lib/check_reqs.js:87:29
在_rejected(/home/matjazmav/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:808:24)
在/home/matjazmav/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:834:30
在Promise.when(/home/matjazmav/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:1079:31)
在Promise.promise.promiseDispatch(/home/matjazmav/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:752:41)
在/home/matjazmav/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:574:44
在冲洗(/home/matjazmav/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:108:17)
在process._tickCallback(node.js中:415:13)
错误:/home/matjazmav/.cordova/lib/android/cordova/3.4.0/bin/create:命令失败,退出code 8
在ChildProcess.whenDone(/usr/lib/node_modules/cordova/src/superspawn.js:126:23)
在ChildProcess.EventEmitter.emit(events.js:98:17)
在maybeClose(child_process.js:743:16)
在Process.ChildProcess._handle.onexit(child_process.js:810:5)
你好$
在Ubuntu的LTS 12.04, 的PhoneGap 3.4.0-0.19.18, 在科尔多瓦3.4.1-0.1.0,
Node.js的,
{http_parser:'1.0', 节点:0.10.26, V8:3.14.5.9, 战神:1.9.0-DEV, 紫外线:0.10.25, zlib的:1.2.3, 模块:'11', OpenSSL的:1.0.1e, 故宫:1.4.3}
和路径设置
$回声$ PATH /usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/ProgramFiles/Android/adt-bundle-linux-x86_64-20140321/sdk/platform-tools:/ProgramFiles/Android/adt-bundle-linux-x86_64-20140321/sdk/tools $
修改: 这里是我的剧本,我又增加了ANT,JAVA和Android为路径:
#!/斌/庆典
明确
出口PATH=${PATH}:/home/matjazmav/ProgramFiles/Android/adt-bundle-linux-x86_64-20140321/sdk/platform-tools:/home/matjazmav/ProgramFiles/Android/adt-bundle-linux-x86_64-20140321/sdk/tools:/usr/lib/jvm/java-6-openjdk-amd64/bin:/home/matjazmav/ProgramFiles/Android/adt-bundle-linux-x86_64-20140321/sdk/:/usr/bin/ant/
回声$ PATH
PhoneGap的创建$ 1 $ 2 $ 3
CD ./$1
#PhoneGap的平台添加的Android#[错误]
PhoneGap的构建Android
下面是输出(前更新的最后两行):
/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/matjazmav/ProgramFiles/Android/adt-bundle-linux-x86_64-20140321/sdk/platform-tools:/home/matjazmav/ProgramFiles/Android/adt-bundle-linux-x86_64-20140321/sdk/tools:/usr/lib/jvm/java-6-openjdk-amd64/bin:/home/matjazmav/ProgramFiles/Android/adt-bundle-linux-x86_64-20140321/sdk/:/usr/bin/ant/ [PhoneGap的]的选项/家庭/ matjazmav /你好输入com.example.hello的HelloWorld [PhoneGap的]通过/ home / matjazmav创建的项目/你好 [错误]平台添加机器人'不是一个节点的/ usr / bin中/ PhoneGap的命令。见节点的/ usr / bin中/ PhoneGap的帮助
谢谢!
解决方案您也应该有
在JAVA_HOME BIN; (其中,JAVA_HOME是JDK文件夹的位置) 在nodejs ; ANT_HOME BIN; (其中ANT_HOME是蚂蚁文件夹的位置) ANDROID_HOME; (其中ANDROID_HOME是Android的SDK文件夹的位置)在路径中。
I am having problem with Phonegap. When I want to add platform with following commands got error:
$ export PATH=${PATH}:/ProgramFiles/Android/adt-bundle-linux-x86_64-20140321/sdk/platform-tools:/ProgramFiles/Android/adt-bundle-linux-x86_64-20140321/sdk/tools
$ cordova create hello com.example.hello "HelloWorld"
Creating a new cordova project with name "HelloWorld" and id "com.example.hello" at location "/home/matjazmav/hello"
$ cd hello
/hello$ cordova platform add android
Creating android project...
/home/matjazmav/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:126
throw e;
^
Error: An error occurred while listing Android targets
at /home/matjazmav/.cordova/lib/android/cordova/3.4.0/bin/lib/check_reqs.js:87:29
at _rejected (/home/matjazmav/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:808:24)
at /home/matjazmav/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:834:30
at Promise.when (/home/matjazmav/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:1079:31)
at Promise.promise.promiseDispatch (/home/matjazmav/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:752:41)
at /home/matjazmav/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:574:44
at flush (/home/matjazmav/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:108:17)
at process._tickCallback (node.js:415:13)
Error: /home/matjazmav/.cordova/lib/android/cordova/3.4.0/bin/create: Command failed with exit code 8
at ChildProcess.whenDone (/usr/lib/node_modules/cordova/src/superspawn.js:126:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Process.ChildProcess._handle.onexit (child_process.js:810:5)
hello$
Ubuntu 12.04 LTS, Phonegap 3.4.0-0.19.18, Cordova 3.4.1-0.1.0,
Node.js,
{ http_parser: '1.0', node: '0.10.26', v8: '3.14.5.9', ares: '1.9.0-DEV', uv: '0.10.25', zlib: '1.2.3', modules: '11', openssl: '1.0.1e', npm: '1.4.3' }
and PATH is set
$ echo $PATH /usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/ProgramFiles/Android/adt-bundle-linux-x86_64-20140321/sdk/platform-tools:/ProgramFiles/Android/adt-bundle-linux-x86_64-20140321/sdk/tools $
EDIT: Here is my script, I had added ANT, JAVA and ANDROID to PATH:
#!/bin/bash
clear
export PATH=${PATH}:/home/matjazmav/ProgramFiles/Android/adt-bundle-linux-x86_64-20140321/sdk/platform-tools:/home/matjazmav/ProgramFiles/Android/adt-bundle-linux-x86_64-20140321/sdk/tools:/usr/lib/jvm/java-6-openjdk-amd64/bin:/home/matjazmav/ProgramFiles/Android/adt-bundle-linux-x86_64-20140321/sdk/:/usr/bin/ant/
echo "$PATH"
phonegap create $1 $2 $3
cd ./$1
# phonegap platform add android # [error]
phonegap build android
Here is output (before updated last two rows):
/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/matjazmav/ProgramFiles/Android/adt-bundle-linux-x86_64-20140321/sdk/platform-tools:/home/matjazmav/ProgramFiles/Android/adt-bundle-linux-x86_64-20140321/sdk/tools:/usr/lib/jvm/java-6-openjdk-amd64/bin:/home/matjazmav/ProgramFiles/Android/adt-bundle-linux-x86_64-20140321/sdk/:/usr/bin/ant/
[phonegap] the options /home/matjazmav/hello com.example.hello HelloWorld
[phonegap] created project at /home/matjazmav/hello
[error] 'platform add android' is not a node /usr/bin/phonegap command. See 'node /usr/bin/phonegap help'
Thanks!
解决方案You should also have
JAVA_HOMEbin; (where JAVA_HOME is the location of jdk folder) nodejs; ANT_HOMEbin; (where ANT_HOME is the location of Ant folder) ANDROID_HOME; (where ANDROID_HOME is the location of android-sdk folder)in your PATH.
相关推荐
最新文章