0

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

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.

Here is my error message :-

* 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)

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'
}

Thanks

user2028
  • 163
  • 4
  • 15
  • 40

3 Answers3

3

I was also getting this problem few months back and was able to solve this problem by approaching to this bellow given link :-

ionic build android error when download gradle

So in short your problem can be solved by using bellow command :-

cordova build android -- --ant

cheers

Community
  • 1
  • 1
sid
  • 1,116
  • 1
  • 10
  • 27
  • 1
    I'm getting this error `Error: Project contains at least one plugin that requires a system library. This is not supported with ANT. Please build using gradle.` after using this command **`cordova build android -- --ant`** – Mohan Gopi May 31 '16 at 07:41
  • Please refer to this link :-http://stackoverflow.com/questions/35890064/error-one-of-your-plugins-required-the-gradle-android-build-tool-to-build – sid May 31 '16 at 07:49
  • `` after adding this line to my config.xml i am getting the same error – Mohan Gopi May 31 '16 at 08:28
  • please take a look at my stack question http://stackoverflow.com/questions/37538143/ionic-build-android-command-fails-with-an-exception-after-trying-to-add-ngcordov/37539362#37539362 – Mohan Gopi May 31 '16 at 08:38
0

Try to update your SDK by this command:

android update sdk --no-ui --filter build-tools-24.0.2,android-24,extra-android-m2repository
wogsland
  • 9,106
  • 19
  • 57
  • 93
rebaimelek
  • 61
  • 2
0

Install this libraries. I fixed issues using these files installing.

sudo apt-get install lib32stdc++6

sudo apt-get install lib32z1