失败:构建失败,但离子异常 [英] FAILURE: Build failed with an exception in ionic
问题描述
我是ionic的新手,只是想使用下面提到的命令来构建我的演示项目的未签名版本:-
I am new to ionic and just trying to make unsigned build of my demo project using the bellow mentioned command :-
cordova build --release android
cordova build --release android
但是在构建apk时,这件事返回了我错误.谁能告诉我该怎么做才能通过命令行获取此未签名的APk.
but this thing is returning me error while building apk. Can anybody tell me what should i do to get this unsigned APk through command line.
这是我的错误消息:-
* Where:
Build file '/home/ravi/Music/FenoLabs/platforms/android/CordovaLib/build.gradle' line: 49
* What went wrong:
A problem occurred evaluating project ':..:..:..:..:..:Music:FenoLabs:platforms:android:CordovaLib'.
> Project with path ':CordovaLib' could not be found in project ':..:..:..:..:..:Music:FenoLabs:platforms:android:CordovaLib'.
* 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: 3.385 secs
/home/ravi/Documents/IonicTest/myDemoApp/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Error code 1 for command: /home/ravi/Documents/IonicTest/myDemoApp/platforms/android/gradlew with args: cdvBuildRelease,-b,/home/ravi/Documents/IonicTest/myDemoApp/platforms/android/build.gradle,-Dorg.gradle.daemon=true
ERROR building one of the platforms: Error: /home/ravi/Documents/IonicTest/myDemoApp/platforms/android/cordova/build: Command failed with exit code 8
You may not have the required environment or OS to build this project
Error: /home/ravi/Documents/IonicTest/myDemoApp/platforms/android/cordova/build: Command failed with exit code 8
at ChildProcess.whenDone (/usr/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:134:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:755:16)
at Process.ChildProcess._handle.onexit (child_process.js:822:5)
这是来自build.gradle文件的一小段代码:-
And here is my small piece of code from build.gradle file :-
apply plugin: 'android'
buildscript {
repositories {
mavenCentral()
}
// Switch the Android Gradle plugin version requirement depending on the
// installed version of Gradle. This dependency is documented at
// http://tools.android.com/tech-docs/new-build-system/version-compatibility
// and https://issues.apache.org/jira/browse/CB-8143
if (gradle.gradleVersion >= "2.2") {
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0+'
}
} else if (gradle.gradleVersion >= "2.1") {
dependencies {
classpath 'com.android.tools.build:gradle:0.14.0+'
}
} else {
dependencies {
classpath 'com.android.tools.build:gradle:0.12.0+'
}
}
}
// Allow plugins to declare Maven dependencies via build-extras.gradle.
repositories {
mavenCentral()
}
task wrapper(type: Wrapper) {
gradleVersion = '2.2.1'
}
谢谢
推荐答案
几个月前我也遇到了这个问题,并且可以通过以下波纹管给定的链接来解决此问题:-
I was also getting this problem few months back and was able to solve this problem by approaching to this bellow given link :-
因此,简而言之,您的问题可以通过使用波纹管命令来解决:-
So in short your problem can be solved by using bellow command :-
cordova构建android---ant
cordova build android -- --ant
欢呼
这篇关于失败:构建失败,但离子异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!