Android Studio 3.0.1 - Emulator black screen - android

I'm using Android studio v3.0.1 and trying to use the emulator. I have created several different virtual devices but all of them fail to boot.
The IDE says 'waiting for target device to come online'.
I have reinstalled Android studio, the emulator, SDK. I have wiped each virtual device and cold booted and still the same.
I have tried the solutions presented in other similar questions on here but it appears to have a different cause.
Is there a fix?
Error message:
15:18 Emulator: qemu-system-i386.exe: Unable to open C:\Users\Sam\.android\avd\Nexus_5_API_27.avd\data\misc\pstore\pstore.bin: Permission denied

Go to the path
C:\Users\Sam\.android\avd\Nexus_5_API_27_2.avd\data\misc\pstore\pstore.bin
right click on pstore, selectProperties and uncheck box Only for reading
Source https://stackoverflow.com/a/48072173/6478047

Related

Android Studio not detecting Microsoft Android Emulator

I installed Microsoft's Android Emulator from here which can now work without disabling Hyper-V on Windows 10. I was following the instructions in this post and everything was working smooth until yesterday. I was successfully able to debug my app in MS android emulator.
Today morning I closed the emulator and started it again. Now, When I start running the app to test it then the MS Android emulator is not showing up in Select Deployment Target window of Android Studio as below. Nexus 5X API 28 emulator visible under Available Virtual Devices is Google's Android emulator which doesn't work with Hyper-V enabled due to reasons mentioned here.
I've already launched the MS Android simulator and it is up and running:
I can see it running in Hyper-V as well as shown below:
Not sure what happened suddenly and it stopped working altogether. Can anyone suggest me the reason behind it or I'm missing something?
If it didn't detected by IDE, try to rerun the emulator and check if it is detecting again or not.
Also, you can try this too:
Tools -> Android -> Enable ADB Integration
If it is already enabled, try to disable and re enable it, seems like this works most of the times.
EDIT: You may want to check:
https://stackoverflow.com/a/38788436/4409113
Changing the value Path then running following commands:
adb kill-server
adb start-server
Might help.
I happened to resolve it by chance. Sharing my experience in case it helps someone in future.
Initially what I was doing is as below:
Start Visual Studio Emulator for Android application which contains the list all the device profiles.
Choose an appropriate device profile and install it.
Run the installed profile and launch the emulator.
Start Android studio, open the project and launch the app.
I simply reversed the above steps to resolve my issue. First close everything including Android Studio, emulators, device profile window etc.:
At first, start Android studio, open the project and hit Run app button to show Select Deployment Target window.
Now, start Visual Studio Emulator for Android application which contains the list of all the device profiles.
Choose an appropriate device profile and install it.
Run the installed profile and launch the emulator. Wait for the Android operating system to get started fully.
The Connected Devices section in Select Deployment Target window would refresh on its own to start showing Microsoft's Android Emulator.
The adb.exe can be seen as an infected file by antivirius software. So need to exclude once reinstated.

Genymotion Emulator Error in Android Studio

Genymotion Emulator Error
I'm repeatedly getting this error
After reading this thread Android Studio doesn't see genymotion
I have successfully included my ADB Location in Genymotion
But it is still showing me Android Studio "Status Off" message
This was the default configuration of the Emulator
And this was the Oracle Virtual Box Setting !OVB_Setting
And after reducing the system processor from 4 to 2 and removing all the Emulators in my Android Studio. It's still giving me the error mentioned in the top. And this is Virtual Box Error:
What am I doing wrong here?
There are two possible issues here.
If you use Windows Creator Update and your version of VirtualBox is the one bundled with Genymotion (5.0.28), then you need to update to VirtualBox 5.1.26 (see https://www.genymotion.com/help/desktop/faq/#compatible-virtualbox-versions)
If this does not help, you might have a firewall which prevents the communication between Genymotion and VirtualBox. In this case, looking at the VBoxHardening.log file mentioned in the last screenshot can help figuring it out. You can find more information about this file in this post from VirtualBox forum.

Android studio: unknown error

I come across a bug of Android studio. When I start my virtual device, it tells me that Unknown error and popup a window saying Intel HAXM is required to run this AVD. Unknown error. Then I reinstall Andorid studio and HAXM, but it cannot work for me. Any one can solve it?
PS: My machine is: win10 64bit Android Studio2.0
This happens when your machine does not support Virtualization. To fix this, you just have to run the emulator with the system image armeabi. Go to your Android Virtual Device Manager, and create a new device. Select your hardware, then click next. Here, it is very important to select a system image with the ABI column saying "armeabi" or "armeabi-v7a". It should look like this:
Continue with the steps, and your emulator should work and run properly.

Android Studio emulator appears in the task manager for 10 seconds and disappears. The emulator window is never displayed

It was working fine till I updated the Android SDK tools from the SDK Manager to version 24.1.2. However a virtual device was running at the time of the update and it asked me to close 3 processes in order for the update to continue. I thought the virtual device was interfering so I closed it and tried to proceed with the update,it gave me the same error. Therefore I cancelled the update and closed the studio. After restarting the studio,it gave an error saying the SDK could not be found and would not let me do anything else. I uninstalled the studio after deleting the SDK folder and reinstalled it. I downloaded the system images needed for the virtual devices and some other packages and created a new virtual device. When I tried to run the application,it gave me the dialogue box to chose the virtual device,I chose the newly created one and it gave the command to start the device. Yet no emulator window for the device appeared.
D:\sdk\tools\emulator.exe -netdelay none -netspeed full -avd MTK
emulator: device fd:5500
HAX is working and emulator runs in fast virt mode
HAXM is installed and it worked fine before. On checking the task manager upon launching the application,an emulator-x86.exe process appears briefly before disappearing. Nothing happens after that. Launching the program again gives the same result. If I try to launch the device from the AVD manager,I get the same result. I have tried using the arm images,varying the ram size,snapshot enabled/disabled,use HOST GPU enabled/disabled,system restarted,removal of /.android content,setting up the SDK in a different drive and deleting the ANDROID_SDK_HOME system variable and resetting it.
I have also tried with Genymotion. The virtual device window briefly appears and I can the see the android logo at startup but then it says "player.exe has encountered a problem and needs to close. We are sorry for the inconvenience." I have tried it using both the Genymotion Android SDK tools and the custom Android SDK tools to no avail. If I try to delete the device it says please stop the virtual device before deleting it even though it is not running.
I spent most of my day trying to solve exactly the same problem until one of my colleagues remembered he had exactly the same issue and that was related to Docker.
Docker uses Hypervisor Framework which is incompatible with the HAXM used by the Android emulator. Therefore if you try to run the Android emulator while Docker is running it will just quit without a warning. Quitting Docker will allow to use the simulator - Docker for Mac conflict with Android emulator
Sometimes it is because you are low on memory, or it might be an AVD specific glitch. I had many (20) devices saved in my AVD and was lower than normal on memory on my laptop. The native emulator folder would disappear right away but genymotion worked fine.
I removed the old devices and create a new one from scratch in AVD and the problem disappeared.

Android emulator fails to start after closing

Using Eclipse (4.2.1) with Android SDK and Virtual Device Manager installed, I'm able to successfully launch the emulator with a device image, run code, etc, etc - however, if I close the emulator any subsequent attempts to restart it fail with the following error:
emulator: Failed to open the hax module
HAX is not working and emulator runs in emulation mode
If I recreate the virtual device and overwrite the existing definition, it will start again (but just the one time). Running OSX 10.8.2, and the AVD is 4.2, Level 17.
Any ideas what's going on here?
Feh... figured it out. I have multiple screens and the issue only happens after I move the emulator to one of the secondary monitors. In that case, a negative position value is getting written to emulator-user.ini. Deleting the file fixes the problem (or just leaving the emulator on the main laptop screen).
Found it in this issue on code.google.com

Categories

Resources