GianL
GianL

Reputation: 33

Ionic cordova | Execution failed for task ':app:processDebugResources' | AAPT: error: resource xml/network_security_config not found

this happens when i try to do an ionic cordova build android

Android resource linking failed D:\blabla\platforms\android\app\build\intermediates\merged_manifests\debug\AndroidManifest.xml:22: AAPT: error: resource xml/network_security_config (aka com.blabla.bla:xml/network_security_config) not found.


> BUILD FAILED in 1s D:\blabla\platforms\android\gradlew: Command failed
> with exit code 1 Error output: FAILURE: Build failed with an
> exception.
> 
> * What went wrong: Execution failed for task ':app:processDebugResources'.
> > Android resource linking failed   D:\blabla\platforms\android\app\build\intermediates\merged_manifests\debug\AndroidManifest.xml:22:
> AAPT: error: resource xml/network_security_config (aka
> com.blabla.bla:xml/network_security_config) not found.
> 
>  
> D:\blabla\platforms\android\app\build\intermediates\merged_manifests\debug\AndroidManifest.xml:22:
> AAPT: error: resource mipmap/ic_launcher_round (aka
> com.blabla.bla:mipmap/ic_launcher_round) not found.
> 
>   error: failed processing manifest.
> 
> * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

my androidManifest.xml has this

<application
    android:debuggable="true"
    android:hardwareAccelerated="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:networkSecurityConfig="@xml/network_security_config"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:usesCleartextTraffic="true" >

my ionic info is like this, cordova is used only and it would not be able to compile the aab format either

Ionic:

Ionic CLI : 6.17.1 Ionic Framework : @ionic/angular 5.1.1 @angular-devkit/build-angular : 0.901.7 @angular-devkit/schematics : 9.1.7 @angular/cli : 9.1.7 @ionic/angular-toolkit : 2.2.0

Capacitor:

Capacitor CLI : 2.1.2 @capacitor/android : not installed @capacitor/core : 2.1.2 @capacitor/ios : not installed

Cordova:

Cordova CLI : 10.0.0 ([email protected]) Cordova Platforms : android 8.1.0 Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 5.0.0, (and 5 other plugins)

Utility:

cordova-res : 0.15.3 native-run : 1.5.0

System:

Android SDK Tools : 26.1.1 NodeJS : v12.14.0 npm : 6.13.4 OS : Windows 10

config.xml is declared like this

<edit-config file="AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
            <application android:icon="@mipmap/ic_launcher" android:networkSecurityConfig="@xml/network_security_config" android:roundIcon="@mipmap/ic_launcher_round" android:usesCleartextTraffic="true" />
        </edit-config>

Upvotes: 1

Views: 805

Answers (1)

Dmitri R117
Dmitri R117

Reputation: 2822

For me this was about plugin version incompatibility, specifically Google Services, which is installed as a support plugin to the main plugins.

Removing the plugins, or downgrading versions solved the issue.

Ultimately the solution (if this is indeed your problem) is to upgrade the environment (Cordova, Node, etc.).

Upvotes: 0

Related Questions