【问题标题】:PhoneGap/Cordova: Libs does not existPhoneGap/Cordova:库不存在
【发布时间】:2014-02-04 20:02:30
【问题描述】:

我刚刚下载了 Cordova,以及 Android 和 Windows Phone 的所有要求。我可以成功构建 WP8 映像并将其发送到我的 8X,但是,我似乎无法构建 Android 映像。

当我执行cordova build android 时,出现以下错误:

从平台“android”的默认值生成 config.xml 准备安卓项目 通过命令“cmd”/c Y:\mobile\platforms\android\cordova\build 在平台“android”上编译应用程序

C:\Users\x\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:126
                    throw e;
                          ^
Error: An error occurred while building the android project.
    at ChildProcess.<anonymous> (C:\Users\x\AppData\Roaming\npm\node_modules\cordova\src\compile.js:65:22)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:735:16)
    at Socket.<anonymous> (child_process.js:948:11)
    at Socket.EventEmitter.emit (events.js:95:17)
    at Pipe.close (net.js:466:12)

当我手动启动构建命令时,出现以下错误:

Error executing "ant debug -f "Y:\mobile\platforms\android\build.xml"":
BUILD FAILED
C:\Development\adt-bundle-windows-x86_64-20131030\sdk\tools\ant\build.xml:962: The following error occurred while executing this line:
C:\Development\adt-bundle-windows-x86_64-20131030\sdk\tools\ant\build.xml:973: The following error occurred while executing this line:
C:\Development\adt-bundle-windows-x86_64-20131030\sdk\tools\ant\build.xml:313: com.android.sdklib.build.ApkCreationException: Y:\mobile\platforms\android\bin\rs
Libs does not exist
        at com.android.sdklib.build.ApkBuilder.getNativeFiles(ApkBuilder.java:742)
        at com.android.ant.ApkBuilderTask.execute(ApkBuilderTask.java:303)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
        at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)

cordova-3.3.0.jar 文件好像没有编译,不应该是自动编译的吗?我有什么遗漏吗?

【问题讨论】:

    标签: android cordova


    【解决方案1】:

    这可能是 Ant 的错误。我有这个错误是因为我忘记更改 环境变量 路径。

    我添加的路径错误(需要指定这个文件夹:“way\to\apache-ant-1.9.3\bin”)。我刚刚更改了它,它现在可以工作了。

    (如果不是,可以是其他路径环境变量,比如node,或者你的java sdk或android sdk)

    希望它可以帮助某人。

    【讨论】:

      【解决方案2】:

      我刚刚删除了整个 Android 项目,重新编译了 CordovaLibs 并重新编译了 Android 项目。好像已经修好了。

      【讨论】:

        【解决方案3】:

        尝试命令

        cordova platform rm android
        cordova platform add android
        cordova build android
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2014-09-07
          • 2013-04-15
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多