微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

android – 更新到3.5.0后Cordova构建错误

我有一个完全在Cordova 3.4上构建的 Android Cordova应用程序.我刚刚更新到Cordova 3.5.0并且构建失败,显示以下错误
-code-gen:
[mergemanifest] Found Deleted Target File
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
     [echo] Handling aidl files...
     [aidl] No AIDL files to compile.
     [echo] ----------
     [echo] Handling RenderScript files...
     [echo] ----------
     [echo] Handling Resources...
     [aapt] Found Deleted Target File
     [aapt] Generating resource IDs...
     [aapt] D:\Proyectos\Trialtea\Proyecto 31 - Aplicaciones HTML5\05. Aplicaciones Google Play\phonegap_projects\InglesEn100DiasTurbo\platforms\andro
id\ant-build\AndroidManifest.xml:2: error: Error: Float types not allowed (at 'versionCode' with value 'NaN').

BUILD Failed
D:\Recursos\Android_Development\adt-bundle-windows-x86_64-20130729\sdk\tools\ant\build.xml:653: The following error occurred while executing this line
:
D:\Recursos\Android_Development\adt-bundle-windows-x86_64-20130729\sdk\tools\ant\build.xml:698: null returned: 1

Total time: 5 seconds
Error code 1 for command: cmd with args: /s,/c,ant,debug,-f,D:\Proyectos\Trialtea\Proyecto 31 - Aplicaciones HTML5\05. Aplicaciones Google Play\phoneg
ap_projects\InglesEn100DiasTurbo\platforms\android\build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen
Error: cmd: Command Failed with exit code 2
    at ChildProcess.whenDone (C:\Users\Albert\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:135:23)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:743:16)
    at Process.ChildProcess._handle.onexit (child_process.js:810:5)

第15行有一个关于错误错误:浮点类型不允许(在’versionCode’中,值为’NaN’,我不知道它为什么会发生.我在项目的根目录中有config.xml文件,版本代码设置为3,但由于某种原因,当我构建项目时,AndroidManifest.xml设置为versionCode =“NaN”.

最后显示错误我不知道它意味着什么或者它是否与上面的错误有关.

任何人都可以帮我解决这个问题吗?

哦,在通过npm更新Cordova后,我还使用cordova platform update android更新了项目文件夹中的Android平台.

解决方法

我已经解决了这个改变www / config.xml中的“version”属性(即使它似乎无关,因为问题在于versionCode).

只需添加第三个次要版本号,例如我从0.6更改为0.6.3

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐