1

when i'm trying to build apk ionic cordova build android use this cmd. i'll get following this error

FAILURE: Build failed with an exception.

What went wrong:

Execution failed for task ':processDebugResources'. com.android.ide.common.process.ProcessException: Failed to execute aapt**

and i'm using

cordova requirements

Requirements check results for android:

Java JDK: installed 1.8.0 Android SDK: installed true Android target: installed android-P,android-27,android-26,android-25,android-24,Google Inc.:Google APIs:24,android-23,Google Inc.:Google APIs:23,android-22,android-21,android-20,android-19,android-18,android-17,android-16,android-15,android Gradle: installed C:\Program Files\Android\Android Studio\gradle\gradle-4.4\bin\gradle

Requirements check results for browser: Check failed for browser due to Failed to check requirements for browser platform. check_reqs module is missing for platform. Skipping it...

ionic info

cli packages: (C:\Windows\System32\node_modules)

ionic (Ionic CLI) : 3.12.0

global packages:

cordova (Cordova CLI) : 7.0.1

local packages:

Cordova Platforms : android 6.2.3 browser 4.1.0
Ionic Framework   : ionic1 1.1.0

System:

Node              : v6.11.3
npm               : 3.10.10

Misc:

backend : pro

How to resolve it.

Vikas
  • 11,859
  • 7
  • 45
  • 69
Krishna
  • 71
  • 1
  • 2
  • 4

4 Answers4

0

I had the same problem and fixed it doing a ./gradlew clean build ! Give it a try and if that doesn't work, try ./gradlew --refresh-dependencies after and you should be good to go.

Copied from Execution failed app:processDebugResources Android Studio

Karthik
  • 1,088
  • 6
  • 17
  • Thanks Mr.Karthik,. – Krishna May 31 '18 at 12:14
  • Thanks Mr.Karthik,. I tried './gradlew --refresh-dependencies' this one..But again i get this same Error.. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':processDebugResources'. > com.android.ide.common.process.ProcessException: Failed to execute aapt – Krishna May 31 '18 at 12:20
  • make sure you have given correct build tools version in build.gradle – Karthik May 31 '18 at 13:08
0

If above solution is not helpful then first check aapt is installed or not?

aapt is 32 bit so will not execute on a 64 bit box until 32 bit architecture is enabled

dpkg --print-foreign-architectures  #  if prints nothing then below is fix

sudo dpkg --add-architecture i386  #  add a 32 bit architecture to box

sudo apt-get install -y lib32gcc1 libc6-i386 lib32z1 lib32stdc++6

sudo apt-get install -y lib32ncurses5 lib32gomp1 lib32z1-dev

it work for me.

rahul.sapkal23
  • 707
  • 9
  • 15
0

one signal plugin is not supported to the version..i'll remove that plugin and add the lower version..It's worked for me.. 1.cordova plugin rm onesignal-cordova-plugin 2.add to manually package.json

dependencies
{
"onesignal-cordova-plugin": "^2.3.2"
}

and

plugins {
"onesignal-cordova-plugin": {}
}

3.npm install 4.ionic cordova build android

Thanks Guys ,

Krishna
  • 71
  • 1
  • 2
  • 4
-1

Probably you have problems with android support library. There is a new version for android - P. You can download this plugin and set support android version, which is your android app sdk target version.

Ali Yılmaz
  • 1,657
  • 1
  • 11
  • 28
VDGone
  • 1
  • 1