Can't build APP after instaling Onesignal Plugin Error :app:mergeDebugResources


I’m trying for days to resolve the error that I keep having when I install the Onesignal plugin :

Command to install Onesignal : ionic cordova plugin add onesignal-cordova-plugin --save

Error when I try to deploy to Android phone :

Execution failed for task ‘:app:mergeDebugResources’.

Error: java.util.concurrent.ExecutionException: AAPT2 error: check logs for details

Solutions that I already tried :

Remove resources Android and IOS and install again.
Remove Android Plataform and intall again.
Remove and add the onesignal plugin.

If I remove the Onesignal plugin I can deploy again to the Android phone…

Any other suggestion ?


ionic info :

    @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.8
    Cordova Platforms  : android 7.0.0
    Ionic Framework    : ionic-angular 3.9.2


    Android SDK Tools : 26.1.1
    Node              : v8.9.4
    npm               : 5.6.0
    OS                : Windows 10

Environment Variables:

    ANDROID_HOME : D:\Programas\AndroidSDK


    backend : pro

cordova plugin list :

cordova-plugin-device 2.0.1 "Device"
cordova-plugin-ionic-keyboard 2.0.5 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 1.1.19 "cordova-plugin-ionic-webview"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-whitelist 1.3.3 "Whitelist"
onesignal-cordova-plugin 2.4.1 "OneSignal Push Notifications"

add this plugin cordova-android-support-gradle-release
remove platform android
add android platform
then build again

Hi thanks, I did what you said but I keep having the same error … :confused:


I also tried to uninstall node and Android studio and nothing seems to help …

Any more suggestions ?