[solved] Execution failed for task ':app:mergeDebugResources'. > Error: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error


#1

Hi,

after installing/uninstalling FCM native plugin I get this error and can’t find a solution (I have tried many solutions that I found in forums with a similar problem), please, do you know how to fix it? thanks in advance:

The error:

[ ... ]
C:\Users\Jos?\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar\8f6936f43da5c51301a950248e1b429b\res\drawable-xhdpi-v4\abc_text_select_handle_middle_mtrl_dark.png: error: file not found.

C:\Users\Jos?\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar\8f6936f43da5c51301a950248e1b429b\res\drawable\abc_ic_menu_overflow_material.xml: error: file not found.

C:\Users\Jos?\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar\8f6936f43da5c51301a950248e1b429b\res\anim\abc_popup_enter.xml: error: file not found.

C:\Users\Jos?\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar\8f6936f43da5c51301a950248e1b429b\res\drawable-hdpi-v4\abc_list_pressed_holo_light.9.png: error: file not found.

C:\Users\Jos?\.gradle\caches\transforms-1\files-1.1\appcompat-v7-27.1.1.aar\8f6936f43da5c51301a950248e1b429b\res\color\abc_tint_switch_track.xml: error: file not found.


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Error: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details

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

* Get more help at https://help.gradle.org

BUILD FAILED in 22m 20s

My conf:

cli packages: (C:\Users\José\AppData\Roaming\npm\node_modules)

    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

global packages:

    cordova (Cordova CLI) : 8.0.0

local packages:

    @ionic/app-scripts : 3.1.7
    Cordova Platforms  : android 7.0.0 browser 5.0.1
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.1.1
    Node              : v6.11.3
    npm               : 3.10.10
    OS                : Windows 10

Environment Variables:

    ANDROID_HOME : C:\android\sdk1

Misc:

    backend : pro

My Plugins:

Package                                                    Current           Wanted       Latest  Location
mx.ferreyra.callnumber                                     MISSING            0.0.2        0.0.2  FirebaseCRUD
@angular/common                                              5.1.3            5.1.3        6.0.4  FirebaseCRUD
@angular/compiler                                            5.1.3            5.1.3        6.0.4  FirebaseCRUD
@angular/compiler-cli                                        5.1.3            5.1.3        6.0.4  FirebaseCRUD
@angular/core                                                5.1.3            5.1.3        6.0.4  FirebaseCRUD
@angular/forms                                               5.1.3            5.1.3        6.0.4  FirebaseCRUD
@angular/http                                                5.1.3            5.1.3        6.0.4  FirebaseCRUD
@angular/platform-browser                                    5.1.3            5.1.3        6.0.4  FirebaseCRUD
@angular/platform-browser-dynamic                            5.1.3            5.1.3        6.0.4  FirebaseCRUD
@angular/tsc-wrapped                                         4.4.6            4.4.7        4.4.6  FirebaseCRUD
@ionic-native/app-minimize                                   4.5.2            4.7.0        4.7.0  FirebaseCRUD
@ionic-native/autostart                                      4.5.2            4.7.0        4.7.0  FirebaseCRUD
@ionic-native/call-number                                    4.5.3            4.7.0        4.7.0  FirebaseCRUD
@ionic-native/core                                           4.5.2            4.5.2        4.7.0  FirebaseCRUD
@ionic-native/date-picker                                    4.5.2            4.7.0        4.7.0  FirebaseCRUD
@ionic-native/geolocation                                    4.5.2            4.7.0        4.7.0  FirebaseCRUD
@ionic-native/google-analytics                               4.5.3            4.7.0        4.7.0  FirebaseCRUD
@ionic-native/native-storage                                 4.5.2            4.7.0        4.7.0  FirebaseCRUD
@ionic-native/network                                        4.5.2            4.7.0        4.7.0  FirebaseCRUD
@ionic-native/sms                                            4.5.3            4.7.0        4.7.0  FirebaseCRUD
@ionic-native/splash-screen                                  4.5.2            4.5.2        4.7.0  FirebaseCRUD
@ionic-native/status-bar                                     4.5.2            4.5.2        4.7.0  FirebaseCRUD
@ionic/app-scripts                                           3.1.7            3.1.7       3.1.10  FirebaseCRUD
angularfire2                                       5.0.0-rc.5-next  5.0.0-rc.5-next  5.0.0-rc.10  FirebaseCRUD
cordova-android                                              7.0.0            7.1.0        7.1.0  FirebaseCRUD
cordova-plugin-autostart                                     2.0.1            2.3.0        2.3.0  FirebaseCRUD
cordova-plugin-device                                        2.0.1            2.0.1        2.0.2  FirebaseCRUD
cordova-plugin-file                                          4.3.3            4.3.3        6.0.1  FirebaseCRUD
cordova-plugin-nativestorage                                 2.2.2            2.3.1        2.3.1  FirebaseCRUD
cordova-plugin-splashscreen                                  5.0.1            5.0.1        5.0.2  FirebaseCRUD
cordova-plugin-statusbar                                     2.4.1            2.4.2        2.4.2  FirebaseCRUD
firebase                                                     4.8.0            4.8.0        5.0.4  FirebaseCRUD
firebase-functions                                           0.8.1            0.8.2        1.0.4  FirebaseCRUD
ionic2-calendar                                              0.4.0            0.4.4        0.4.4  FirebaseCRUD
ionicons                                                     3.0.0            3.0.0        4.1.2  FirebaseCRUD
moment                                                      2.20.1           2.22.2       2.22.2  FirebaseCRUD
moment-range                                                 3.1.1            3.1.1        4.0.1  FirebaseCRUD
rxjs                                                         5.5.6           5.5.11        6.2.1  FirebaseCRUD
typescript                                                   2.6.2            2.6.2        2.9.2  FirebaseCRUD
uk.co.workingedge.phonegap.plugin.launchnavigator            4.2.0            4.2.1        4.2.1  FirebaseCRUD
zone.js                                                     0.8.19           0.8.19       0.8.26  FirebaseCRUD

Error while generating APK application
#2

Finally I found a solution, I downgrade android platform from 7.0.0 to previous 6.3.1

cordova platform rm android
....
cordova platform add android@6.3.0

and added this line

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

to build.gradle in android platform folder.