PhoneGap Build 上的 Hello World
Hello World on PhoneGap Build
我正尝试在 https://build.phonegap.com/apps/ 上做 Hello World(仅针对 Android)。
我创建了一个目录。把它命名为www。添加了以下 index.html。压缩它。然后上传到 https://build.phonegap.com/apps/ 希望能取回 .apk 文件。
index.html
<!doctype html>
<html>
<head>
<title>PG Test</title>
</head>
<body> Hello World </body>
</html>
相反,我得到的只是这条错误消息。
错误
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.
上面错误信息中的"here"link带你here: http://plugins.cordova.io/npm/index.html。它说 "Page not found."
问题
Please supply the necessary source code for Phone Gap Build to generate an .apk file for Android.
尝试更新 phonegap 或任何相关程序,因为其中一个似乎已过时。如果您使用任何插件,例如在您的应用中添加插件,请尝试查看它们是否也是最新版本。
删除并重新启动而不是更新代码
我的解决方案是删除我现有的应用程序(而不是 "update code")。显然,有一些 "caching" 之前的代码没有被覆盖,所以我不得不完全擦除旧的 .zip 文件并重新开始一个新的。
然后成功了。
插件被拉入 config.xml
经过更多的修补,我可能开始明白发生了什么。我刚刚从 github.com/phonegap/phonegap-start 下载了 phonegap-start 应用程序,同样的问题又出现了。我认为问题是由 config.xml 文件中引用的插件源文件引起的。而且我认为当我选择 "update code" 而不是删除旧应用程序并重新开始时,这些引用并没有被删除。 config.xml 文件的相关部分如下。
config.xml 片段
<!-- Core plugins -->
<gap:plugin name="org.apache.cordova.battery-status" />
<gap:plugin name="org.apache.cordova.camera" />
<gap:plugin name="org.apache.cordova.media-capture" />
<gap:plugin name="org.apache.cordova.console" />
<gap:plugin name="org.apache.cordova.contacts" />
<gap:plugin name="org.apache.cordova.device" />
<gap:plugin name="org.apache.cordova.device-motion" />
<gap:plugin name="org.apache.cordova.device-orientation" />
<gap:plugin name="org.apache.cordova.dialogs" />
<gap:plugin name="org.apache.cordova.file" />
<gap:plugin name="org.apache.cordova.file-transfer" />
<gap:plugin name="org.apache.cordova.geolocation" />
<gap:plugin name="org.apache.cordova.globalization" />
<gap:plugin name="org.apache.cordova.inappbrowser" />
<gap:plugin name="org.apache.cordova.media" />
<gap:plugin name="org.apache.cordova.network-information" />
<gap:plugin name="org.apache.cordova.splashscreen" />
<gap:plugin name="org.apache.cordova.vibration" />
FWIW:你没有提到任何关于你的 config.xml
的事情。在这一点上,我假设你正在使用你得到的那个——没有修改。
好的。我将为您提供快速修复。但首先你应该知道你有很多错误。这个快速修复会让你继续,但你应该阅读我不止一次列出的文档。
Top Mistakes by Developers new to Cordova/Phonegap
快速修复 将此添加到您的 config.xml
以供 PHONEGAP 仅构建
<preference name="phonegap-version" value="3.7.0" />
出现这些错误的主要原因有两个。
- 插件存储库已移至 NPM。您的代码表明您没有跟上。 (#11)
- 如果您在构建时没有设置编译器版本。 (#6)
来自上面 link 的#6:
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.
重复一遍,你不走运。您收到 一组级联错误
您应该阅读#6、#7、#10 和#11。
祝你好运,让我知道进展如何。
This Youtube video shows how to install and use PhoneGap Build using a sample application. https://www.youtube.com/watch?v=UOjoNEUFeVE
Here is the Github repository of the source code. https://github.com/ccoenraets/EmployeeDirectory
有效!
我想我会在 using the cca (Chrome Cordova App) toolchain to develop Mobile Chrome Apps 之前完全转向不同的方向。
我正尝试在 https://build.phonegap.com/apps/ 上做 Hello World(仅针对 Android)。
我创建了一个目录。把它命名为www。添加了以下 index.html。压缩它。然后上传到 https://build.phonegap.com/apps/ 希望能取回 .apk 文件。
index.html<!doctype html>
<html>
<head>
<title>PG Test</title>
</head>
<body> Hello World </body>
</html>
相反,我得到的只是这条错误消息。
错误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.
上面错误信息中的"here"link带你here: http://plugins.cordova.io/npm/index.html。它说 "Page not found."
问题
Please supply the necessary source code for Phone Gap Build to generate an .apk file for Android.
尝试更新 phonegap 或任何相关程序,因为其中一个似乎已过时。如果您使用任何插件,例如在您的应用中添加插件,请尝试查看它们是否也是最新版本。
删除并重新启动而不是更新代码
我的解决方案是删除我现有的应用程序(而不是 "update code")。显然,有一些 "caching" 之前的代码没有被覆盖,所以我不得不完全擦除旧的 .zip 文件并重新开始一个新的。
然后成功了。
插件被拉入 config.xml
经过更多的修补,我可能开始明白发生了什么。我刚刚从 github.com/phonegap/phonegap-start 下载了 phonegap-start 应用程序,同样的问题又出现了。我认为问题是由 config.xml 文件中引用的插件源文件引起的。而且我认为当我选择 "update code" 而不是删除旧应用程序并重新开始时,这些引用并没有被删除。 config.xml 文件的相关部分如下。
config.xml 片段<!-- Core plugins -->
<gap:plugin name="org.apache.cordova.battery-status" />
<gap:plugin name="org.apache.cordova.camera" />
<gap:plugin name="org.apache.cordova.media-capture" />
<gap:plugin name="org.apache.cordova.console" />
<gap:plugin name="org.apache.cordova.contacts" />
<gap:plugin name="org.apache.cordova.device" />
<gap:plugin name="org.apache.cordova.device-motion" />
<gap:plugin name="org.apache.cordova.device-orientation" />
<gap:plugin name="org.apache.cordova.dialogs" />
<gap:plugin name="org.apache.cordova.file" />
<gap:plugin name="org.apache.cordova.file-transfer" />
<gap:plugin name="org.apache.cordova.geolocation" />
<gap:plugin name="org.apache.cordova.globalization" />
<gap:plugin name="org.apache.cordova.inappbrowser" />
<gap:plugin name="org.apache.cordova.media" />
<gap:plugin name="org.apache.cordova.network-information" />
<gap:plugin name="org.apache.cordova.splashscreen" />
<gap:plugin name="org.apache.cordova.vibration" />
FWIW:你没有提到任何关于你的 config.xml
的事情。在这一点上,我假设你正在使用你得到的那个——没有修改。
好的。我将为您提供快速修复。但首先你应该知道你有很多错误。这个快速修复会让你继续,但你应该阅读我不止一次列出的文档。
Top Mistakes by Developers new to Cordova/Phonegap
快速修复 将此添加到您的 config.xml
以供 PHONEGAP 仅构建
<preference name="phonegap-version" value="3.7.0" />
出现这些错误的主要原因有两个。
- 插件存储库已移至 NPM。您的代码表明您没有跟上。 (#11)
- 如果您在构建时没有设置编译器版本。 (#6)
来自上面 link 的#6:
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.
重复一遍,你不走运。您收到 一组级联错误
您应该阅读#6、#7、#10 和#11。
祝你好运,让我知道进展如何。
This Youtube video shows how to install and use PhoneGap Build using a sample application. https://www.youtube.com/watch?v=UOjoNEUFeVE
Here is the Github repository of the source code. https://github.com/ccoenraets/EmployeeDirectory
有效!
我想我会在 using the cca (Chrome Cordova App) toolchain to develop Mobile Chrome Apps 之前完全转向不同的方向。