Question: Yesterday I got a new upgrade for the Android N preview. Ever since I upgraded, I cannot start my app anymore. 

```
java.io.IOException: Cleartext HTTP traffic to myserver.com not permitted

```

I have tried to set the `usesCleartextTraffic` to `true` in the manifest or to add a `network_security_config.xml` 

```
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <domain-config cleartextTrafficPermitted="true">
        <domain includeSubdomains="true">myserver.com</domain>
    </domain-config>
</network-security-config>

```

Neither did work. Any ideas about what is going on there?

When I try to define networkSecurityConfig in the manifest, I get a compile error

```
Error:(35) No resource identifier found for attribute 'networkSecurityConfig' in package 'android'

```

Not really sure why. The file is there and everything looks good.

Found [this](https://code.google.com/p/android/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Status%20Priority%20Owner%20Summary%20Stars%20Reporter%20Opened&groupby=&sort=&id=212584) suggestion in the Android issue tracker from Google. They suggest to move the `network_security_config` definition to the `meta-data`. I still get the same exception though.

Answer: 
[![enter image description here](https://i.stack.imgur.com/VP8S0.png)](https://i.stack.imgur.com/VP8S0.png)

res/xml/network\_security\_config.xml

```
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true">
    <trust-anchors>
        <certificates src="system" />
    </trust-anchors>
</base-config>
</network-security-config>

```

AndroidManifest.xml

```
<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme"
    tools:ignore="GoogleAppIndexingWarning"

    android:networkSecurityConfig="@xml/network_security_config">

    <activity android:name=".activity.MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

</application>

```
Create a XML res/xml/network\_security\_config.xml

```
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <base-config cleartextTrafficPermitted="true" />
</network-security-config>

```

Reference this file in your tag Application, inside AndroidManifest.xml. Like:

```
android:networkSecurityConfig="@xml/network_security_config"

```