gpt4 book ai didi

android - Phonegap - Android 构建错误

转载 作者:行者123 更新时间:2023-11-29 01:27:36 27 4
gpt4 key购买 nike

这是我所做的。

在命令行中:

$ phonegap -v
5.3.6

$ phonegap create myfirstproject
Creating a new cordova project.
Downloading hello-world-template libarary for www...
Download Complete

$ cd myfirstproject

$ phonegap remote login
[phonegap] Phonegap/Build Login
[phonegap] Sign up at build.app.com
[warning] Github accounts are unsupported
[prompt] enter username: myusername
[prompt] enter password: **********
[phonegap] logged in as myusername

$ phonegap remote run android
[phonegap] compressing the app
[phonegap] uploading the app
[phonegap] building the app
[error] error occured while building the android app

然后我去https://build.phonegap.com并登录。我转到我的应用程序,然后单击“android”并将我重定向到我的项目构建。我点击“日志”按钮,我得到了这个:

-compile:
[javac] Compiling 43 source files to /project/bin/classes
[javac] /project/src/org/apache/cordova/filetransfer/FileTransfer.java:692: error: cannot find symbol
[javac] if (!isLocalTransfer && !Config.isUrlWhiteListed(source)) {
[javac] ^
[javac] symbol: method isUrlWhiteListed(String)
[javac] location: class Config
[javac] /project/src/org/apache/cordova/inappbrowser/InAppBrowser.java:122: error: cannot find symbol
[javac] || Config.isUrlWhiteListed(url)) {
[javac] ^
[javac] symbol: method isUrlWhiteListed(String)
[javac] location: class Config
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 2 errors

BUILD FAILED
/android-sdk/tools/ant/build.xml:716: The following error occurred while executing this line:
/android-sdk/tools/ant/build.xml:730: Compile failed; see the compiler error output for details.

Total time: 6 seconds

/project/cordova/node_modules/q/q.js:126
throw e;
^
Error code 1 for command: ant with args: debug,-f,/project/build.xml

有人知道这个错误吗?我们如何解决这个问题?

最佳答案

我刚找到答案!

我收到这些错误的原因是 phonegap/cordova 将他们的插件源移到了 NPM

这是我为解决问题所做的。

我更新了 config.xml 中的所有“插件名称及其来源”,例如:

来自这里:

<gap:plugin name="org.apache.cordova.camera" />

为此:

<gap:plugin name="cordova-plugin-camera" source="npm" />

现在,我成功构建了应用程序。 =)

引用:

关于android - Phonegap - Android 构建错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33061758/

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