简体   繁体   中英

Android Emulator - connecting to a public API over the internet

I have a React-Native app that uses a remote API to to authenticate and login to the app. This works flawlessly with the iOS emulator, however Android is a different story. The network request fails when trying to reach the API address and my app is unable to authenticate with the API. I see a lot of documentation about connecting the emulator to localhost however the API I'm using is over the web and NOT local to my machine. Is it possible to make public http requests to an API using android emulator.

The emulator is able to use the browser and browse the internet fine.

这不是足够的信息,但是要检查的一件事是查看您是否在AndroidManifest.xml具有此权限- <uses-permission android:name="android.permission.INTERNET" />

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM