<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>The Ops Community ⚙️: Ngà Phạmm</title>
    <description>The latest articles on The Ops Community ⚙️ by Ngà Phạmm (@ng_phmm_e8ead4aeea7f085).</description>
    <link>https://community.ops.io/ng_phmm_e8ead4aeea7f085</link>
    <image>
      <url>https://community.ops.io/images/1nCdDm7UzHp-FjU5dQNBO-bFTzG2LLErlULZdXhGWGo/rs:fill:90:90/g:sm/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL3Vz/ZXIvcHJvZmlsZV9p/bWFnZS8yNTc1MS9m/MWFjNThiMS03NDY3/LTQzNDEtODMyZS1l/NjZkMDkyZjY0ODYu/anBn</url>
      <title>The Ops Community ⚙️: Ngà Phạmm</title>
      <link>https://community.ops.io/ng_phmm_e8ead4aeea7f085</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://community.ops.io/feed/ng_phmm_e8ead4aeea7f085"/>
    <language>en</language>
    <item>
      <title>Has Anyone Run Into This With Local API Testing in Android Emulators?</title>
      <dc:creator>Ngà Phạmm</dc:creator>
      <pubDate>Fri, 08 Aug 2025 07:46:13 +0000</pubDate>
      <link>https://community.ops.io/ng_phmm_e8ead4aeea7f085/has-anyone-run-into-this-with-local-api-testing-in-android-emulators-2khc</link>
      <guid>https://community.ops.io/ng_phmm_e8ead4aeea7f085/has-anyone-run-into-this-with-local-api-testing-in-android-emulators-2khc</guid>
      <description>&lt;p&gt;First-time poster here, and I’m hoping someone in the community has seen this before.&lt;/p&gt;

&lt;p&gt;I’ve been running some local API tests in an Android emulator (Pixel 6 image, API 33), and I’m hitting a strange situation where my Retrofit calls work fine on physical devices but consistently fail with a CLEARTEXT communication not permitted by network security policy error inside the emulator.&lt;/p&gt;

&lt;p&gt;Here’s what I’ve tried so far:&lt;/p&gt;

&lt;p&gt;Confirmed the local server is reachable on my host machine.&lt;br&gt;
Added the correct android:usesCleartextTraffic="true" in the manifest.&lt;br&gt;
Double-checked Network Security Config XML.&lt;br&gt;
Tested on multiple emulator images (API 29, 31, 33).&lt;br&gt;
Used adb reverse to map ports — still no luck.&lt;br&gt;
Why I’m posting:&lt;br&gt;
I know this is a fairly common topic for Android/DevOps workflows, but what’s confusing here is that the exact same build works fine on real hardware. I’m wondering if there’s some emulator-specific network setting I’m missing, or if this is a known quirk when testing local APIs.&lt;/p&gt;

&lt;p&gt;I’ve uploaded my simplified test project here so it’s easier to reproduce:&lt;br&gt;
&lt;a href="https://modhello.com/tabs-pocket-edition" rel="noopener noreferrer"&gt;https://modhello.com/tabs-pocket-edition&lt;/a&gt;&lt;br&gt;
(it’s just a stripped-down example app + configs — no sensitive data, meant purely for debugging together)&lt;/p&gt;

&lt;p&gt;My questions to the community:&lt;/p&gt;

&lt;p&gt;Has anyone else experienced emulator-only network policy errors like this?&lt;br&gt;
Are there any common pitfalls with emulator DNS/loopback I should double-check?&lt;br&gt;
Is there a cleaner workaround than enabling cleartext traffic globally?&lt;br&gt;
Thanks in advance — I’d really appreciate any tips or “oh yeah, I’ve been there” stories from others.&lt;br&gt;
It feels like one of those small things that’s obvious… once you know it.&lt;/p&gt;

&lt;p&gt;Environment details for reference:&lt;/p&gt;

&lt;p&gt;Android Studio Giraffe | 2022.3.1 Patch 2&lt;br&gt;
Emulator: Pixel 6 (API 33, Google Play image)&lt;br&gt;
Backend: Local Node.js API running on localhost:3000&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
