Reputation: 443
I have read quite many posts about this topic but nothing was relevant for my "special" case.
Hope someone can help
android sdk: 27
android studio: 3.0.1
My internet connection works correctly and hasn't any problem.
but when I launch emulator, it's not able to use internet.
Can anybody help?
here is the screenshot of my emulator.
Upvotes: 1
Views: 1792
Reputation: 443
It was about some net problem and was not important thing. it will be fixed after closing and reopening emulator...
Upvotes: 0
Reputation: 6961
According to Android Studio user guide there are 2 possible reasons for the emulator not being able to use your machine's network connection:
Communication with the emulated device may be blocked by a firewall program running on your machine.
Communication with the emulated device may be blocked by another (physical) firewall/router to which your machine is connected.
However, if your emulator is able to access network (open browser or google play app to check), yet your app isn't - check the manifest file for INTERNET permission:
<manifest xlmns:android...>
...
<uses-permission android:name="android.permission.INTERNET" />
<application ...
</manifest>
EDIT: To solve the problem with the firewall block try launching the Emulator from the command line as follows:
emulator -verbose -avd <AVD name>
This will give you detailed output and may show the error that's preventing the emulator from connecting to the Internet.
Upvotes: 1