Reputation: 1239
I'm using Android Studio 2020.3.1 Patch 2, on Windows 10 and I'm running an Android 12 emulator.
I'm attempting to simply load any webpage using Google Chrome, however all that happens is that the progress bar appears, but nothing ever loads regardless of the website that I try to load. The other thing that happens is that sometimes Chrome just sits on the loading screen itself and doesn't finish loading when started.
I've verified that the emulator has internet access, and in fact I can get webpages to load using the Webview Browser Tester app that is present in the emulator by default.
Stumped with this one, any help is appreciated.
Upvotes: 78
Views: 45891
Reputation: 99
Create a file called advancedFeatures.ini
with the content:
Vulkan = off
GLDirectMem = on
The path of this file should be:
/Users/"yourUser"/.android
C:\Users\"yourUser"\.android
on android make sure you create a device that has playstore option(sign) and uses "Software-GLE 2.0" in Emulated performance:Graphics (might be needed that you actually log in in playstore via emulator to update emulator chrome version)
might be needed: switching camera options to 'None'
inside .android folder(can refer to paths above) check /avd/"emulatorName/config.ini"
hw.gpu.enabled=yes
hw.gpu.mode=software
If you want to open link directly
adb shell am start -a "android.intent.action.VIEW" -d "http://your.url.here"
Upvotes: 10
Reputation: 11
I was able to fix this by updating the Android emulator package to the latest version.
How to: On Android studio, click on the Tools menu at the top, click SDK Manager then, click on SDK Tools Tab, you'd see a list of SDK developer tools. Look for Android emulator and other packages that requires update(for those installed). Update them. Go to your device manager, wipe data and relaunch your AVD, it should work!
Upvotes: 1
Reputation: 2201
An alternative way to resolve this issue, without editing an INI file, is to start the emulator from the command line and add -feature -Vulkan as one of the parameters.
Upvotes: 1
Reputation: 187
It is also possible, to set the emulated Graphics Performance to "Software - GLES2.0" in the Virtual Device Configuration.
Upvotes: 5
Reputation: 541
This helped me to resolve my issue with Android 12 doesn't load any webpages. I'm using Android studio Chipmunk 2021.2.1 on Windows 10 and I'm running Android 12 emulator with API31. What I did:
Vulkan = off
GLDirectMem = on
advancedFeatures.ini
-> you can directly save it in .android file
or wherever you want and then move it to .android
file. Path example: C:/Users/your user name/.android
Upvotes: 54
Reputation: 1636
It's caused by vulkan. To fix it, you must turn vulkan off on emulator or chrome.
# Here's how to disable Vulkan apps to talk to the emulator.
# Add the following lines to ~/.android/advancedFeatures.ini (create this file if it doesn't exist already):
Vulkan = off
GLDirectMem = on
If you want to use both vukan and chrome on emulator, just mark vulkan flag as disabled in chrome://flags and re-enable Vulkan on emulator by changing Vulkan
value to on or deleting advancedFeatures.ini
.
Upvotes: 162