0

I'm trying to build an Android version of a "blank" project with IONIC, now i'm stuck with this error. Has anyone experienced this before, and what would your answer be?

FAILED

BUILD FAILED

Total time: 2.179 secs FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':CordovaLib:processDebugResources'.

    com.android.ide.common.process.ProcessException: Failed to execute aapt

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Error: cmd: Command failed with exit code 1 Error output: FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':CordovaLib:processDebugResources'.

    com.android.ide.common.process.ProcessException: Failed to execute aapt

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

[ERROR] An error occurred while running cordova build android (exit code 1).

3
  • Check whether your ANDROID_HOME variable is set. Also can you elborate on the Steps and commands u tried to get this error. Commented Dec 4, 2017 at 15:39
  • ANDROID_HOME has been set to the SDK path, JAVA_HOME to 1.8 path. Other paths: %ANDROID_HOME%\build-tools, %ANDROID_HOME%\tools\bin\sdkmanager, %ANDROID_HOME%\platform-tools, %ANDROID_HOME%\tools, %JAVA_HOME%\bin. In console: $ ionic cordova build android. This gives me the error. I've must overlooked something. @Lokkeshwaran Commented Dec 5, 2017 at 10:49
  • Found out it has to do with Android itself. I prepared the Android version with the command: ionic cordova prepare android, then I opened the build with Android Studio.Then I adjusted the build.gradle file, commented //debugCompile(project(path: "CordovaLib", configuration: "debug")) //releaseCompile(project(path: "CordovaLib", configuration: "release")) and added: compile project(':CordovaLib') Commented Dec 5, 2017 at 12:49

1 Answer 1

1

The way i solved this problem is as below:

  1. npm uninstall cordova ionic

  2. npm install -g [email protected] [email protected]

  3. cordova platform rm android

  4. cordova platform add android

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.