Build failed Failed to execute aapt

HI,
I have a problem with building my project

ionic cordova build android --verbose

it shows me

UP-TO-DATE
:processArmv7DebugResources
/home/yajuve/ionic/mobilogistic-all/platforms/android/build/intermediates/manifests/full/armv7/debug/AndroidManifest.xml:28: AAPT: No resource identifier found for attribute 'appComponentFactory' in package 'android'
    
/home/yajuve/ionic/mobilogistic-all/platforms/android/build/intermediates/manifests/full/armv7/debug/AndroidManifest.xml:28: error: No resource identifier found for attribute 'appComponentFactory' in package 'android'


 FAILED

FAILURE: Build failed with an exception.

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

BUILD FAILED

Total time: 16.097 secs
Error: /home/yajuve/ionic/mobilogistic-all/platforms/android/gradlew: Command failed with exit code 1 Error output:
/home/yajuve/ionic/mobilogistic-all/platforms/android/build/intermediates/manifests/full/armv7/debug/AndroidManifest.xml:28: AAPT: No resource identifier found for attribute 'appComponentFactory' in package 'android'
    
/home/yajuve/ionic/mobilogistic-all/platforms/android/build/intermediates/manifests/full/armv7/debug/AndroidManifest.xml:28: error: No resource identifier found for attribute 'appComponentFactory' in package 'android'



FAILURE: Build failed with an exception.

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

[ERROR] An error occurred while running cordova build android (exit code 1).

List plugins installed

cordova-plugin-background-mode 0.7.2 "BackgroundMode"
cordova-plugin-compat 1.2.0 "Compat"
cordova-plugin-crosswalk-webview 2.4.0 "Crosswalk WebView Engine"
cordova-plugin-device 1.1.4 "Device"
cordova-plugin-file 4.3.3 "File"
cordova-plugin-filepath 1.0.2 "FilePath"
cordova-plugin-ionic-webview 1.1.16 "cordova-plugin-ionic-webview"
cordova-plugin-mobiwire-print 0.0.5 "mobiwireprinter"
cordova-plugin-sim 1.3.3 "SIM"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-whitelist 1.3.1 "Whitelist"
ionic-plugin-keyboard 2.2.1 "Keyboard"

Ionic info


    @ionic/cli-utils  : 1.19.1
    ionic (Ionic CLI) : 3.19.1

global packages:

    cordova (Cordova CLI) : 6.5.0 

local packages:

    @ionic/app-scripts : 3.1.0
    Cordova Platforms  : android 6.3.0 browser 4.1.0
    Ionic Framework    : ionic-angular 3.9.2

System:

    Node : v6.14.0
    npm  : 3.10.10 
    OS   : Linux 3.10

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : legacy

Thanks in advance

I am also facing the same issue since yesterday. Please post if you find any solution for it. Thanks

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

Find build.gradle in your platforms folder and add the above code to that
it will work .

6 Likes

not working for me got same error again

try :

npm -g install cordova@latest then => cordova plugin add cordova-android-support-gradle-release

hi there, you need to use cordova android@8.0.0

• Run:
ionic cordova platform rm android

• Run:
ionic cordova platform add android@8.0.0

• Run:
ionic cordova plugin add cordova-plugin-androidx

• Run:
ionic cordova plugin add cordova-plugin-androidx-adapter

with this steps your build will work again

1 Like