How can I ignore a file and specific line of code during build in react native application (Android)

24 Views Asked by At

In my React Native code base, there is a file named

network_security_config.xml

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <domain-config cleartextTrafficPermitted="true">
        <domain includeSubdomains="true">10.0.2.2</domain>
        <domain includeSubdomains="true">localhost</domain>
    </domain-config>
</network-security-config>

and this file is used here.

 <application
      android:name=".MainApplication"
      android:label="@string/app_name"
      android:icon="@mipmap/ic_launcher"
      android:roundIcon="@mipmap/ic_launcher_round"
      android:allowBackup="false"
      android:theme="@style/AppTheme"
      android:networkSecurityConfig="@xml/network_security_config" //This line 
    >

So I need to ignore this line of code in AndroidManifest.xml: android:networkSecurityConfig="@xml/network_security_config" also network_security_config.xml this file while building Android. How can I do this? 

0

There are 0 best solutions below