简体   繁体   English

我无法构建localy我的Android应用程序 - 新的phonegap

[英]I cannot build localy my android app - New to phonegap

I am very new to phonegap. 我对phonegap很新。 I have follow any step to install phonegap and now I am faced with a problem I cannot determine the solution. 我已经按照任何步骤安装phonegap,现在我遇到了一个问题我无法确定解决方案。

I am starting by executing the commands: 我首先执行命令:

phonegap create hello
cd hello

and then I am executing the following command and I am getting the result you can read: 然后我执行以下命令,我得到你可以读到的结果:

E:\Web Development Projects\dch\p\phonegap.dch\hello>phonegap local build android
phonegap  adding the Android platform...

C:\Users\MyNAme\AppData\Roaming\npm\node_modules\phonegap\node_modules\cordova\src\metadata\android_parser.js:35
    throw new Error('The provided path "' + project + '" is not an Android
          ^
Error: The provided path "E:\Web Development Projects\dch\p\phonegap.dch\hello\platforms\android" is not an Android project.
at Object.android_parser (C:\Users\MyNAme\AppData\Roaming\npm\node_modules\phonegap\node_modules\cordova\src\metadata\android_parser.js:35:15)
at C:\Users\MyNAme\AppData\Roaming\npm\node_modules\phonegap\node_modules\cordova\src\prepare.js:67:23
at Array.map (native)
at Object.prepare (C:\Users\MyNAme\AppData\Roaming\npm\node_modules\phonegap\node_modules\cordova\src\prepare.js:65:30)
at C:\Users\MyNAme\AppData\Roaming\npm\node_modules\phonegap\node_modules\cordova\src\platform.js:234:47
at C:\Users\MyNAme\AppData\Roaming\npm\node_modules\phonegap\node_modules\cordova\node_modules\shelljs\shell.js:1707:7
at ChildProcess.exithandler (child_process.js:577:7)
at ChildProcess.EventEmitter.emit (events.js:97:17)
at maybeClose (child_process.js:677:16)
at Process.ChildProcess._handle.onexit (child_process.js:744:5)

In my system I have properly installed the following: 在我的系统中,我已正确安装以下内容:

Node.js
jre7
jdk1.7.0_45
Android SDK
Ant

and are registered all the appropriate system path variable that pointing to the required folders to run the phonegap. 并注册所有适当的系统路径变量,指向运行phonegap所需的文件夹。

Is there any solution to this problem ? 有没有解决这个问题的方法?

UPDATE 1 更新1

I try to find out what's wrong, and I found that the C:\\Users\\MyNAme\\AppData\\Roaming\\npm\\node_modules\\phonegap\\node_modules\\cordova\\src\\metadata\\android_parser.js is looking for a file named AndroidManifest.xml under the path E:\\Web Development Projects\\dch\\p\\phonegap.dch\\hello\\platforms\\android . 我试图找出问题所在,我发现C:\\Users\\MyNAme\\AppData\\Roaming\\npm\\node_modules\\phonegap\\node_modules\\cordova\\src\\metadata\\android_parser.js正在寻找名为AndroidManifest.xml的文件在路径E:\\Web Development Projects\\dch\\p\\phonegap.dch\\hello\\platforms\\android

Unfortunatelly I don't have any folder named android under my platforms folde of my app, and thus I don't even have the AndroidManifest.xml file. 不幸的是,我的app平台下面没有任何名为android的文件夹,因此我甚至没有AndroidManifest.xml文件。

So, the qeustion is, did I meased any step ? 所以,qeustion是,我是否在任何步骤? :? :?

UPDATE 2 更新2

I just run the following command as described by the MBilau: 我按照MBilau的描述运行以下命令:

phonegap -d local platform add android

and I got the following output: 我得到以下输出:

error 'platform' is not a node C:\User\MyName\AppData\Raoming\npm\node_modules\phonegap\bing\phonegap.js command. See 'node C:\User\MyName\AppData\Roaming\npm\node_modules\phonegap\bin\phonegap.js help'

Is there anybody who can help ? 有人可以提供帮助吗? :? :?

Before you run phonegap local build I think you need to run phonegap local platform add android , which will add /android/ folder to your /platforms/ directory. 在你运行phonegap local build之前我认为你需要运行phonegap local platform add android ,它会将/android/文件夹添加到你的/platforms/目录。 It will also pull in all of the needed files to create an Android app, like the Manifest file. 它还会引入所有需要的文件来创建一个Android应用程序,比如Manifest文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM