AndroidManifest.xml
| 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <!-- |
| 3 | Debug-only overlay. The one thing it changes is cleartext HTTP. |
| 4 | |
| 5 | The main manifest sets android:usesCleartextTraffic="false" on purpose, and |
| 6 | that stays true for every release build. But the emulator reaches a server |
| 7 | running on the developer's own machine as http://10.0.2.2:7372, and with the |
| 8 | flag off the platform blocks that connection outright, before any code runs. |
| 9 | There is no certificate to install and no hostname to except, so the flag has |
| 10 | to be flipped for the debug build. |
| 11 | |
| 12 | tools:replace is required: manifest merger keeps the stricter value from the |
| 13 | main manifest otherwise, and reports a conflict rather than overriding it. |
| 14 | |
| 15 | This cannot leak into a release: the merger only reads src/debug for the debug |
| 16 | build type, which also carries its own applicationIdSuffix. |
| 17 | --> |
| 18 | <manifest xmlns:android="http://schemas.android.com/apk/res/android" |
| 19 | xmlns:tools="http://schemas.android.com/tools"> |
| 20 | |
| 21 | <application |
| 22 | android:usesCleartextTraffic="true" |
| 23 | tools:replace="android:usesCleartextTraffic" /> |
| 24 | </manifest> |
| 25 |