gpt4 book ai didi

cordova - Phonegap 错误 : "An error occurred while listing Android targets" while installing Phonegap on Ubuntu

转载 作者:行者123 更新时间:2023-12-04 13:11:32 25 4
gpt4 key购买 nike

http://cordova.apache.org/docs/en/3.3.0/guide_platforms_android_index.md.html#Android%20Platform%20Guide

正如上面文档中提到的,我已经安装了 Phonegap 所需的软件,因为我有版本:

对于 Java:

$ java -version java version "1.7.0_51" Java(TM) SE Runtime

Environment (build 1.7.0_51-b13) Java HotSpot(TM) 64-Bit Server VM
(build 24.51-b03, mixed mode)



对于 Ant

$ ant -version

Apache Ant(TM) version 1.8.2 compiled on December 3
2011



对于 Node.JS

$ npm -version

1.4.3



现在,问题是当我为 Android 创建一个像“$cordova create hello com.example.hello HelloWorld”这样的 phonegap 项目时,它会创建名为“hello”的项目目录。

但是现在,当我在“hello”目录中输入这个命令“$cordova platform add android”时,它给了我下面给出的错误:

/hello$ cordova platform add android Creating android project...

/home/deep/.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/deep/.cordova/lib/android/cordova/3.4.0/bin/lib/check_reqs.js:87:29 at _rejected (/home/deep/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:808:24) at /home/deep/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:834:30 at Promise.when (/home/deep/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:1079:31) at Promise.promise.promiseDispatch (/home/deep/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:752:41) at /home/deep/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:574:44 at flush (/home/deep/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:108:17) at process._tickCallback (node.js:415:13) Error: /home/deep/.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:112: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)



如何摆脱这个问题?

最佳答案

我可以通过关注 cordova-guide 来解决这个问题。 .简而言之:

  • 下载 adt-bundle
  • 将其解压缩到我选择的位置
  • 将命名文件夹添加到 PATH多变的:
    export PATH=${PATH}:/home/me/opt/adt-bundle/sdk/platform-tools:/home/me/opt/adt-bundle/sdk/tools
  • 关于cordova - Phonegap 错误 : "An error occurred while listing Android targets" while installing Phonegap on Ubuntu,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22551453/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com