Phonegap Build android - 错误“添加android平台” ENOENT [英] Phonegap Build android - error "Adding the android platform" ENOENT

查看:126
本文介绍了Phonegap Build android - 错误“添加android平台” ENOENT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Helo,
我目前正在尝试建立一个自动创建的基本phonegapp Android应用程序,所以我导航到目录...但是当我使用命令

Helo, I am currently trying to build the base phonegapp android app that's automatically created, so I navigated to the directory... but when I use the command

phonegap build android

错误,如所附图片所示。

I just get this random error, as shown in the attatched picture.

额外信息

我目前在Windows 8上,是全新的制作应用程序,也是命令行的新手。不太熟悉这个东西...

I am currently on Windows 8, and am completely new to making apps, and am new to the command line as well. Not very familiar with this stuff...

我想要做的是编译,对吧?

What I'm trying to do would be called 'compiling', right?

推荐答案

是的,昨天我也有同样的问题 - 但有一个同事的帮助我得到了!

Yeah, I had the same problem yesterday - but with a little help of a colleague I got it!


  1. 安装 node js

  2. 使用命令行安装phonegap: npm install -g phonegap

  3. 安装 Android SDK

  4. 启动Android SDK Manager并安装Android 4.4.2( API19)

    • 由于最新的phonegap / cordova版本需要此

    • Android SDK和SDK平台的文档应该已足够

    • 也更新现有的套件

  1. Install node js
  2. Install phonegap using command line: npm install -g phonegap
  3. Install Android SDK
  4. Launch Android SDK Manager and install Android 4.4.2 (API19)
    • Because latest phonegap/cordova version requires this
    • Documentation for Android SDK and SDK Platform should be enough
    • Also update already existing packages

  • %ANT_HOME%\bin;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools;%JAVA_HOME%\bin

  • 每个文件夹由分号分隔

设置环境变量只对新的命令行窗口生效。所以你应该重新打开它,在整个过程。

Setting environment variables will take effect just for new command line windows. So you should reopen it, after the whole process.

很容易,不是吗? ; - )

Easy, isn't it? ;-)

现在你可以在创建一个新的phonegap项目后使用 phonegap build android 如果您通过USB插入智能手机并安装了USB驱动程序,并在智能手机上激活了USB调试,您可以使用

Now you can use phonegap build android after you've created a new phonegap project. If you have your smartphone plugged via USB and installed the USB drivers, and activated the USB Debugging on smartphone, you may use

phonegap run android

准备就绪的APK将被传输并在智能手机上执行。非常适合测试。

And the ready build APK will be transfered and executed on your smartphone. Perfect for testing.

如果您要创建最终版本APK,请转到
YOURPROJECT\platforms\android\ ant-build
并输入 ant发布
您将在 YOURPROJECT\platforms\android\bin 中找到最终的APK。

If you want to create a final release APK, go to YOURPROJECT\platforms\android\ant-build and enter ant release. You'll find the final APKs in YOURPROJECT\platforms\android\bin.

它们是未签名的,这是一个 Noob指南来签署APK

They are unsigned, here is a Noob guide to signing an APK.

我已经测试过条形码扫描器示例,它可以无缝地工作。

I have tested a Barcode Scanner example, and it works seamlessly.

有乐趣!

这篇关于Phonegap Build android - 错误“添加android平台” ENOENT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆