Error when ionic build android ':processDebugResources'


#1

I have some error when do ionic build android. I don’t do anything when i try build apk error showing. Error log like this

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':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.

Command finished with error code 1: cmd /s /c ""D:\Backup\Adit Desain\platforms\
android\gradlew.bat" cdvBuildDebug -b "D:\Backup\Adit Desain\platforms\android\b
uild.gradle" -Dorg.gradle.daemon=true -Dorg.gradle.jvmargs=-Xmx2048m -Pandroid.u
seDeprecatedNdk=true"


(node:6684) UnhandledPromiseRejectionWarning: Error: cmd: Command failed with ex
it code 1 Error output:
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:f
ont
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:f
ontStyle
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:f
ontWeight


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':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.
    at ChildProcess.whenDone (D:\Backup\Adit Desain\platforms\android\cordova\no
de_modules\cordova-common\src\superspawn.js:169:23)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

(node:6684) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This
error originated either by throwing inside of an async function without a catch
block, or by rejecting a promise which was not handled with .catch(). (rejection
 id: 1)
(node:6684) [DEP0018] DeprecationWarning: Unhandled promise rejections are depre
cated. In the future, promise rejections that are not handled will terminate the
 Node.js process with a non-zero exit code.

If someone can help me ? thanks


#2

i think you need to add cordova-android-support-gradle-release…


#3

this cordova plugin add cordova-android-support-gradle-release --fetch ? I already install this plugin and add in build.gradle

configurations.all {
    resolutionStrategy.force 'com.android.support:support-v4:27.1.0'
}

#4

Hi @rizkaomg, I’m facing the same issue. Have you found any solution to this?

I followed @anicacute09 's suggestion adding that plugin but now, when I try to build apk, a different error appears, specifically this:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.

BUILD FAILED

Total time: 3.522 secs
> Could not find common.jar (android.arch.core:common:1.1.0).
  Searched in the following locations:
      https://jcenter.bintray.com/android/arch/core/common/1.1.0/common-1.1.0.jar

* 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:
A problem occurred configuring root project 'android'.
> Could not find common.jar (android.arch.core:common:1.1.0).
  Searched in the following locations:
      https://jcenter.bintray.com/android/arch/core/common/1.1.0/common-1.1.0.jar

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

#5

whether you’ve tried

cordova platform rm android/ios 
cordova platform add android/ios

because some people work with this but not for me