你好世界PhoneGap构建 [英] Hello World on PhoneGap Build

查看:205
本文介绍了你好世界PhoneGap构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 https://build.phonegap.com/尝试执行Hello World(仅适用于Android) apps /



我创建了一个目录。命名为www。添加以下index.html。压缩它。然后将其上传到 https://build.phonegap.com/apps/ ,希望回来。



index.html

 <!doctype html> 
< html>
< head>
< title> PG Test< / title>
< / head>
< body> Hello World< / body>
< / html>

相反,我得到的是这个错误讯息。



错误

 错误 - 如果使用
PhoneGap> = 4.0.0,一些官方插件必须更新。请升级任何
插件的版本,其中可能包括以下文件:
FileTransfer.java - 您可以在这里解决这个问题。

上述错误讯息中的here连结会带您此处 http://plugins.cordova.io/npm/index.html



解决方案 / div>

FWIW:你没有提到你的 config.xml 。在这一点上,我假设你正在使用你得到的 - 没有修改。



好吧。我要给你快速修复。但首先你应该知道你有大量的错误。这个快速解决方案会让你去,但你应该阅读我已经提出多次的文档。



开发者对Cordova / Phonegap的新评论错误



QUICK FIX 将此添加到您的 config.xml 仅限PHONEGAP BUILD

< preference name =phonegap-versionvalue =3.7.0/>



您收到这些错误的原因有两个。


  1. 插件存储库已移至NPM。您的代码显示您没有跟上。 (#11)

  2. 如果您在构建时未设置编译器版本。 (#6)

从上面链接的#6开始:


对于CLI版本,如果你没有为你的平台分配一个版本或者在'Phonegap Build''如果你没有在config.xml中设置phonegap-version,你会得到最新的版本。如果你幸运,你的程序只是按预期工作。如果您不幸运,您会收到一组级联错误。


重复一遍,你不幸运。您会得到设置的级联错误
您应该阅读#6,#7,#10& #11。



最好的运气,让我知道它是怎么回事。


I am trying to do Hello World (for Android only) at https://build.phonegap.com/apps/.

I created a directory. Named it www. Added the following index.html. Zipped it. Then uploaded it to https://build.phonegap.com/apps/ hoping to get back an .apk file.

index.html

<!doctype html>
<html>
<head>
  <title>PG Test</title>
</head>
<body> Hello World </body>
</html>

Instead, all I got was this error message.

Error

Error - Some official plugins have to be updated if using
PhoneGap >= 4.0.0. Please upgrade the version of any
plugins that may include the following file:
FileTransfer.java - You can fix this here.

The "here" link in the above error message takes you here: http://plugins.cordova.io/npm/index.html. Where it says "Page not found."

Question

Please supply the necessary source code for Phone Gap Build to generate an .apk file for Android.

解决方案

FWIW: you have not mentioned anything about your config.xml. At this point I am assuming you are using the one you get - without modification.

Okay. I'm going to give you the quick fix. But first you should know you have a large amount of errors. This quick fix will get you going, but you should read the document I've laid out more than once.

Top Mistakes by Developers new to Cordova/Phonegap

QUICK FIX Add this to your config.xml for PHONEGAP BUILD ONLY
<preference name="phonegap-version" value="3.7.0" />

There are two large reasons you are getting these errors.

  1. The plugin repository has moved to NPM. Your code shows you are not keeping up. (#11)
  2. If you do NOT set the compiler version when you did your build. (#6)

From #6 on the link above:

With the CLI version, if you do not assign a version for your platform OR in ''Phonegap Build'' if you do not set the phonegap-version in config.xml, YOU WILL GET THE LATEST VERSION. If you are lucky, your program just works as expected. If you are not lucky, you'll get a set of cascading error.

TO repeat, you are not lucky. You are getting the set of cascading error
You should read #6, #7, #10 & #11.

Best of Luck, let me know how it is going.

这篇关于你好世界PhoneGap构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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