Build Failed when ionic cordova run android

#1

I get error while run android , please Help !!.

#2

Hi, @Firsya
Add the following lines to your platforms/android/build.gradle

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

if still having issue try running this command:

cordova plugin add cordova-android-support-gradle-release --fetch
#3

Hi @addwebsolution thank u for your respon,

i have try your solutions, but there is still getting error when ionic cordova run android

Note: Recompile with -Xlint:deprecation for details.
D:\Mobile\Dev\myapp\platforms\android\res\xml\config.xml:33:53-81: AAPT: No resource found that matches the given name (at ‘networkSecurityConfig’ with value ‘@xml/network_security_config’).

D:\Mobile\Dev\myapp\platforms\android\build\intermediates\res\merged\debug\xml\config.xml:33: error: Error: No resource found that matches the given name (at ‘networkSecurityConfig’ with value ‘@xml/network_security_config’).

FAILURE: Build failed with an exception.

#4

Hi,
have you tried both the solutions?

#5

yes , i try both solutions but still getting error

#6

Hi,
Please fire these commands first and then try to build app may be your problem can be solved by doing this:

cordova platform rm android
cordova platform add android
#7

Hi I try to add network_security_config.xml in platforms\android\build\intermediates\res\merged\debug\xml

<?xml version="1.0" encoding="utf-8"?>

its works for me, but i dont know what effect it has

reference https://codelabs.developers.google.com/codelabs/android-network-security-config/#3