离子Android编译停止工作 [英] Ionic Android build stopped working

查看:139
本文介绍了离子Android编译停止工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的离子/科尔多瓦应用程序有所有突然停止更新离子和科尔多瓦CLI后,在Android上构建。我花了近2天为一个解决方案,谷歌搜索,但我无法找到任何帮助。我假设它的东西与科尔多瓦做现在用摇篮打造,而不是Apache Ant的的。我的Andr​​oid SDK和编译工具均达到22版,2.2摇篮,蚂蚁1.9.4,JDK 8。

其他信息:结果
科尔多瓦CLI:5.1.1结果
离子CLI版本:1.6.1结果
离子应用程序库版本:0.3.3结果
操作系统:Mac OS X约塞米蒂
节点版本:v0.12.7

当我运行离子构建Android,我得到这个错误:

 故障:建立失败,一个例外。*其中:
脚本'/platforms/android/CordovaLib/cordova.gradle'行:128* 什么地方出了错:
发生问题的根源评估项目机器人。
>没有找到匹配*尝试:
与--stacktrace选项获取堆栈跟踪运行。与--info或--debug选项来运行,以获得更多的日志输出。构建失败总时间:1.426秒/platforms/android/cordova/node_modules/q/q.js:126
                    Ë扔掉;
                          ^
错误code 1命令:/平台/安卓/ gradlew与ARGS:cdvBuildDebug,-b,/平台/安卓/的build.gradle,-Dorg.gradle.daemon =真
ERROR建设的平台之一:错误:/平台/安卓/科尔多瓦/编译:命令失败,退出code 1
您可能没有所需的环境或操作系统来构建这个项目
错误:/平台/安卓/科尔多瓦/编译:命令失败,退出code 1
    在ChildProcess.whenDone(/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:134:23)


解决方案

您可能需要设置android的版本code在config.xml文件。我有一个类似的问题,是由来自0.0.1到1改变code解决。显然,Android的希望一个整数值。

在我的config.xml中我不得不改变这一点:

 <控件ID =com.acme.appname版本=0.0.1的Andr​​oid版本code =0.0.1IOS-CFBundleVersion =0.0 .1的xmlns =http://www.w3.org/ns/widgets的xmlns:CDV =http://cordova.apache.org/ns/1.0>

这样:

 <控件ID =com.acme.appname版本=0.0.1的Andr​​oid版本code =1IOS-CFBundleVersion =0.0.1 的xmlns =http://www.w3.org/ns/widgets的xmlns:CDV =http://cordova.apache.org/ns/1.0>

我希望这有助于。

My Ionic/Cordova app has all of a sudden stopped building on Android after updating the Ionic and Cordova CLI. I've spent the last 2 days searching Google for a solution but I couldn't find anything that has helped. I'm assuming it's something to do with Cordova now using Gradle to build instead of Apache Ant. My Android SDK and build tools are all up to version 22, Gradle 2.2, Ant 1.9.4, JDK 8.

Other details:
Cordova CLI: 5.1.1
Ionic CLI Version: 1.6.1
Ionic App Lib Version: 0.3.3
OS: Mac OS X Yosemite Node Version: v0.12.7

When I run ionic build android, I get this error:

FAILURE: Build failed with an exception.

* Where:
Script '/platforms/android/CordovaLib/cordova.gradle' line: 128

* What went wrong:
A problem occurred evaluating root project 'android'.
> No match found

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 1.426 secs

/platforms/android/cordova/node_modules/q/q.js:126
                    throw e;
                          ^
Error code 1 for command: /platforms/android/gradlew with args: cdvBuildDebug,-b,/platforms/android/build.gradle,-Dorg.gradle.daemon=true
ERROR building one of the platforms: Error: /platforms/android/cordova/build: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: /platforms/android/cordova/build: Command failed with exit code 1
    at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:134:23)

解决方案

You might need to set the android-versionCode in your config.xml file. I had a similar issue that was resolved by changing the code from "0.0.1" to "1". Apparently Android wants a single integer value.

In my config.xml I had to change this:

<widget id="com.acme.appname" version="0.0.1" android-versionCode="0.0.1" ios-CFBundleVersion="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">

to this:

<widget id="com.acme.appname" version="0.0.1" android-versionCode="1" ios-CFBundleVersion="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">

I hope this helps.

这篇关于离子Android编译停止工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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