Android build broken after gradle dependencies update: Execution failed for task ':processDebugResources'. > com.android.ide.common.process.ProcessException: Failed to execute aapt

@leonardoss I had to set ANDROID_HOME too to my SDK folder

I am at Android Studio 2.3.3, at this moment the problem is with Support revision 27.0.0, if some plugin require AppCompat wiht + operator, it will install latest revision with a values.xml file that contains the tag:

com.android.support:support-v4:+

After build, the file is ‘platforms\android\build\intermediates\exploded-aar\com.android.support\support-compat\27.0.0\res\values\values.xml’

and the code that is causing the issue is (line 7):

<declare-styleable name="FontFamily"><attr format="string" name="fontProviderAuthority"/><attr format="string" name="fontProviderPackage"/><attr format="string" name="fontProviderQuery"/><attr format="reference" name="fontProviderCerts"/><attr name="fontProviderFetchStrategy">
            
            <enum name="blocking" value="0"/>
            
            <enum name="async" value="1"/>
        </attr><attr format="integer" name="fontProviderFetchTimeout">
          
            <enum name="forever" value="-1"/>
        </attr></declare-styleable>
    <declare-styleable name="FontFamilyFont"><attr name="fontStyle">
            <enum name="normal" value="0"/>
            <enum name="italic" value="1"/>
        </attr><attr format="reference" name="font"/><attr format="integer" name="fontWeight"/><attr name="android:fontStyle"/><attr name="android:font"/><attr name="android:fontWeight"/></declare-styleable>

I am trying to fix the version of appcompat in my project.properties file inside android platform project.

That is very strange because the file seems not well idented, maybe someone dropped this code in the file by mistake.

1 Like

My ionic info and cordova requirements

    @ionic/cli-utils  : 1.13.1
    ionic (Ionic CLI) : 3.13.1

global packages:

    cordova (Cordova CLI) : 6.5.0 

local packages:

    @ionic/app-scripts : 2.1.4
    Cordova Platforms  : android 6.3.0 ios 4.3.1
    Ionic Framework    : ionic-angular 3.3.0

System:

    Android SDK Tools : 26.1.1
    ios-deploy        : 1.9.1 
    ios-sim           : 6.0.0 
    Node              : v8.2.1
    npm               : 5.3.0 
    OS                : macOS Sierra
    Xcode             : Xcode 9.0.1 Build version 9A1004 

Misc:

    backend : legacy
Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed android-26,android-25,android-24,android-23,android-22,android-21,Google Inc.:Google APIs:21,android-19,android-18,android-16
Gradle: installed /Applications/Android Studio.app/Contents/gradle/gradle-3.2/bin/gradle

Requirements check results for ios:
Apple OS X: installed darwin
Xcode: installed 9.0.1
ios-deploy: installed 1.9.1
CocoaPods: installed 

@yoojene can you post the content of your project.properties file, you can find it inside platforms/android (root folder).

Nice investigation, that sounds like a very reasonable lead.

Another user posted something related here a bit ago, maybe this helps to find a workaround:

1 Like
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
target=android-26
android.library.reference.1=CordovaLib
cordova.system.library.1=com.android.support:support-v4:24.1.1+
cordova.gradle.include.1=cordova-plugin-crosswalk-webview/XXXX-xwalk.gradle
cordova.system.library.2=com.android.support:support-v4:+
cordova.system.library.3=com.google.android.gms:play-services-analytics:+
cordova.system.library.4=com.android.support:support-v4:24.1.1+
cordova.system.library.5=com.android.support:support-v4:+
cordova.gradle.include.2=urbanairship-cordova/XXXX-build-extras.gradle
1 Like

igual yo … ud ya encontro alguna solucion?

I have the same problem.
Last week worked with this but today, after the Ionic/gradle update, that fix working no more.


cli packages: (/Users/silviu/Ionic Projects/Comunicare/node_modules)

    @ionic/cli-utils  : 1.15.2
    ionic (Ionic CLI) : 3.15.2

global packages:

    cordova (Cordova CLI) : 7.1.0 

local packages:

    @ionic/app-scripts : 2.1.4-201709131805
    Cordova Platforms  : android 6.3.0 ios 4.5.2
    Ionic Framework    : ionic-angular 3.6.0

System:

    ios-deploy : 1.9.0 
    ios-sim    : 5.0.8 
    Node       : v8.6.0
    npm        : 5.3.0 
    OS         : macOS Sierra
    Xcode      : Xcode 9.0.1 Build version 9A1004 

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : legacy

I’m stuck wit this for 2 hours…

Same here.

cli packages: (/Users/dindigital02/.nvm/versions/node/v6.11.3/lib/node_modules)

    @ionic/cli-utils  : 1.15.2
    ionic (Ionic CLI) : 3.15.2

global packages:

    cordova (Cordova CLI) : 7.0.1

local packages:

    Cordova Platforms : android 6.2.3 ios 4.5.1
    Ionic Framework   : ionic1 1.3.3

System:

    ios-deploy : 1.9.2
    ios-sim    : 6.1.1
    Node       : v6.11.3
    npm        : 3.10.10
    OS         : macOS Sierra
    Xcode      : Xcode 9.0.1 Build version 9A1004

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : legacy

Thanks @nncl and @silvius for including your ionic info output.

Some more things that would help:

  1. Post your ionic cordova requirements output please.
  2. What Android Studio version do you have installed?
  3. Have you tried to remove and re-add the platform?
  4. What does your platforms/android/project.properties look like?
  5. What plugins is your project using (ionic cordova plugin list give you a list)

Hi @Sujan12

  1. Cordova requirements:
Requirements check results for android:

Java JDK: installed 1.8.0

Android SDK: installed true
Android target: installed android-26,android-25,android-16

Gradle: installed /Applications/Android Studio.app/Contents/gradle/gradle-3.2/bin/gradle

Requirements check results for ios:
Apple macOS: installed darwin

Xcode: installed [object Object]
ios-deploy: installed [object Object]

CocoaPods: installed [object Object]
  1. Android Studio Version: 2.3.3

  2. I’ve tried re-add the platform


# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
target=android-25
android.library.reference.1=CordovaLib
cordova.system.library.1=com.android.support:support-v4:24.1.1+
cordova.system.library.2=com.android.support:support-v4:24.1.1+
cordova.system.library.3=com.onesignal:OneSignal:3.6.1
cordova.gradle.include.1=onesignal-cordova-plugin/br-build-extras-onesignal.gradle
cordova.system.library.4=com.google.android.gms:play-services-gcm:+
cordova.system.library.5=com.google.android.gms:play-services-location:+
cordova.system.library.6=com.android.support:support-v4:+
cordova.system.library.7=com.android.support:customtabs:+
  1. Plugins

cordova-plugin-camera 2.4.1 "Camera"
cordova-plugin-compat 1.1.0 "Compat"
cordova-plugin-device 1.1.6 "Device"
cordova-plugin-inappbrowser 1.7.1 "InAppBrowser"
cordova-plugin-ionic-webview 1.1.16 "cordova-plugin-ionic-webview"
cordova-plugin-screen-orientation 2.0.1 "Screen Orientation"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-statusbar 2.2.3 "StatusBar"
cordova-plugin-whitelist 1.3.2 "Whitelist"
cordova-plugin-x-socialsharing 5.2.0 "SocialSharing"
es6-promise-plugin 4.1.0 "Promise"
ionic-plugin-keyboard 2.2.1 "Keyboard"
onesignal-cordova-plugin 2.2.0 "OneSignal Push Notifications"
1 Like

@Sujan12:
1.

> cordova requirements

Requirements check results for android:

Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed android-26,android-25
Gradle: installed /Applications/Android Studio.app/Contents/gradle/gradle-4.1/bin/gradle


Requirements check results for ios:

Apple macOS: installed darwin

Xcode: installed [object Object]

ios-deploy: not installed 

Cordova needs ios-deploy version 1.9.2 or greater, you have version 1.9.0. Please download, build and install version 1.9.2 or greater from https://github.com/phonegap/ios-deploy into your path, or do 'npm install -g ios-deploy'

CocoaPods: installed [object Object]
Error: Some of requirements check failed
  1. Android Studio 3.0
  2. Yes, for a 100 times
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
target=android-26
android.library.reference.1=CordovaLib
cordova.system.library.1=com.facebook.android:facebook-android-sdk:4.+
cordova.system.library.2=com.android.support:support-v4:+
cordova.system.library.3=com.onesignal:OneSignal:3.6.1
cordova.gradle.include.1=onesignal-cordova-plugin/tsd2020-build-extras-onesignal.gradle
cordova.system.library.4=com.google.android.gms:play-services-gcm:+
cordova.system.library.5=com.google.android.gms:play-services-location:+
cordova.system.library.6=com.android.support:support-v4:+
cordova.system.library.7=com.android.support:customtabs:+
> cordova plugin ls
✔ Running command - done!
cordova-plugin-compat 1.1.0 "Compat"
cordova-plugin-device 1.1.4 "Device"
cordova-plugin-facebook4 1.9.1 "Facebook Connect"
cordova-plugin-file 4.3.3 "File"
cordova-plugin-file-opener2 2.0.19 "File Opener2"
cordova-plugin-file-transfer 1.6.3 "File Transfer"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-statusbar 2.2.2 "StatusBar"
cordova-plugin-whitelist 1.3.1 "Whitelist"
cordova-plugin-wkwebview-engine 1.1.4-dev "Cordova WKWebView Engine"
ionic-plugin-keyboard 2.2.1 "Keyboard"
onesignal-cordova-plugin 2.2.0 "OneSignal Push Notifications"
1 Like

in my case it is with Cordova 7.0.1 and my android is 2.2.3. This happened to me this morning I gave a cordova compile android and I downloaded several things like those that are mentioned in the beginning of the forum
"Download https://maven.google.com/com/android/support/support-v4/27.0.0/support-v4-27.0.0.pom
Download https://maven.google.com/com/android/support/customtabs/27.0.0/customtabs-27.0.0.pom "
etc.

  • Already try removing and adding the android platform. I get the same result

  • my installed plugins are:

com.neton.cordova.diagnostic 0.2.3 "Diagnostic"
cordova-android-play-services-gradle-release 1.1.1 "cordova-android-play-service
s-gradle-release"
cordova-plugin-afnetworking 2.5.2 "AFNetworking Cordova Plugin"
cordova-plugin-backbutton 0.3.0 "Backbutton"
cordova-plugin-background-mode 0.7.2 "BackgroundMode"
cordova-plugin-barcodescanner 0.7.0 "BarcodeScanner"
cordova-plugin-battery-status 1.1.2 "Battery"
cordova-plugin-camera 2.2.0 "Camera"
cordova-plugin-compat 1.0.0 "Compat"
cordova-plugin-console 1.0.3 "Console"
cordova-plugin-device 1.1.2 "Device"
cordova-plugin-device-orientation 1.0.3 "Device Orientation"
cordova-plugin-dialogs 1.2.1 "Notification"
cordova-plugin-fastrde-checkgps 0.9.9 "checkGPS"
cordova-plugin-file 4.2.0 "File"
cordova-plugin-file-transfer 1.5.1 "File Transfer"
cordova-plugin-geolocation 2.2.0 "Geolocation"
cordova-plugin-globalization 1.0.3 "Globalization"
cordova-plugin-google-analytics 1.6.0 "Google Universal Analytics Plugin"
cordova-plugin-image-picker 1.1.1 "ImagePicker"
cordova-plugin-media-capture 1.3.0 "Capture"
cordova-plugin-network-information 1.3.3 "Network Information"
cordova-plugin-printer 0.7.2 "Printer"
cordova-plugin-screen-orientation 1.4.2 "Screen Orientation"
cordova-plugin-uniquedeviceid 1.3.2 "UniqueDeviceID"
cordova-plugin-whitelist 1.2.2 "Whitelist"
de.appplant.cordova.plugin.email-composer 0.8.3 "EmailComposer"
es.keensoft.fullscreenimage 1.0.1 "Full Screen Image"
org.flybuy.cordova.background-location-services 1.1.1 "CDVBackgroundLocationServ
ices"
phonegap-plugin-barcodescanner 6.0.6 "BarcodeScanner"
phonegap-plugin-push 1.8.0 “PushPlugin”

1 Like

That unfortunately probably won’t work at all for some more time: Google released Android Studio 3.0, you should probably NOT upgrade yet (as Cordova is not ready yet but working on it)

But both @silvius and @nncl have something like this here in their project.properties:

Since the API 27 release yesterday this downloads a version that doesn’t work…

So I think @leonardoss is right in what he wrote above: Android build broken after gradle dependencies update: Execution failed for task ':processDebugResources'. > com.android.ide.common.process.ProcessException: Failed to execute aapt - #64 by leonardoss

Some plugin is including too new stuff, which makes Gradle download it and then can’t build.

Can you check your plugins which one does that?

1 Like

Hi guys… I’ve finally resolve this problem…
in my case, I updated my sdk manager (include some API`S)

run the command: “npm install -g ionic cordova”;

remove the platform: “ionic cordova rm platform android”;

remove the plugin compact “ionic cordova plugin rm cordova-plugin-compat --force”;

and add the platform this way: “ionic cordova platform add android@6.3.0”;

and everything is good again!

4 Likes

I was having same issues with the 2.x version. I upgraded because of the build problem…

PS: “You’re replying too quickly. Please wait x minutes before trying again.” is annoying

1 Like

It was already solved by @yoojene, just need to update sdk to android-26 and then remove any mention to cordova-plugin-compat in plugins/android.json and plugins/fetch.json, by some reason it is not removed by plugin remove command I believe that because geolocation and file plugins require compat plugin, as compat is already included in cordova-android@6.3.0, file and geolocation plugin are not affected.

1 Like

Hm, that gives me another idea you all can try:
npm install cordova-plugin-compat@1.2.0

You all have this plugin.

From the README of the plugin:

This plugin is no longer being worked on as the functionality provided by this plugin is now included in cordova-android 6.3.0. You should upgrade your application to use version 1.2.0 of this plugin. It will detect whether or not the plugin is required based on the version of cordova-android your app uses.

It is all related to support-v4@27.0.0 and cordova-android@6.2.3 (that was my version) and the cordova-plugin-compat@1.2.0

By upgrading to cordova-android@6.3.0 and removing cordova-plugin-compat.

cordova plugin rm cordova-plugin-compat --force
cordova platform rm android
ionic cordova platform add android@6.3.0

if you face an issue about PermissionHelper, check if cordova-plugin-compat and his mentions in plugins/android.json and plugins/fetch.json are removed and it will solve permission problem.

Thanks to anyone that was involved to find a workaround for that, thanks @Sujan12 :wink:

11 Likes