Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 29536

How do I get my Android emulator (via Android Studio) to send network requests through my VPN so it can access my dev environment sites?

$
0
0

I am developing a React Native application on a Macbook Pro and using the Android emulator in Android Studio for testing. I use a VPN to access my dev environment sites. Last week, the Android emulator began to encounter issues with my dev API endpoints and my network requests that go to my dev site no longer succeed. Nothing had recently changed with my endpoints at the time the issue began. My code's fetch requests no longer return the JSON, but I can still access the dev site through my browser while connected to my VPN and see the JSON data being returned so I know the API is functional. It just seems that the emulator is not using the VPN for its network requests (and therefore can't access the dev sites), because it returns a "network request failed" in my try-catch block around the fetch request. Additionally, I am unable to simply navigate to my dev site through Chrome on the Android emulator. The endpoints are working fine with my iOS simulator.

I have tried wiping the data from the emulator in Android Studio and also doing a cold boot of the emulator, but neither of those fixed the issue. I read a lot of other issues where users found success after making sure their VPN was connected before opening the emulator (or vice versa), and I have tried those as well but nothing was successful. I also have navigated into Android Studio and uninstalled and reinstalled my SDK Tools, but nothing changed.

What are some other things I could attempt to try to fix this issue? Thanks for the assistance.


Viewing all articles
Browse latest Browse all 29536

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>