Android Studio can't connect to AVD or real device - android

My Android Studio version is 2.1.2 in Windows 10. there is no problem before, but today this occurred. And I can not debug my app.
How to solve ?
emulator: WARNING: VM heap size set below hardware specified minimum of 384MB
emulator: WARNING: Setting VM heap size to 384MB
And
emulator: WARNING: ./android/metrics/metrics_reporter_toolbar.cpp:164: Can't upload usage metrics: Error
Run
Event Log

go to tools-->android-->avd manager
edit android virtual device and select show advanced settings
go to memory and storage and set VM heap 400MB
click finish and run avd

Do you see any errors? Try to
adb kill-server

Connect only one device through usb, close all the running emulators. Now run the project. It would show the device to run. Later start emulator and run the app, this time the emulator also would be shown to run the app.
This happened to me also, I have resolved in the above said way.

Related

Android studio unable to run emulator: Process finished with exit code 2

I am trying to use an emulator in Android Studio 3.1.4, but I keep getting the error messages:
Emulator: Could not launch
'C:\Users\Ian\AppData\Local\Android\Sdk\emulator/qemu/windows-x86_64/qemu-system-i386.exe':
No such file or directory.
and
Emulator: Process finished with exit code 2.
This happens with every device I am trying to emulate.
I tried increasing the RAM on the emulator, but it had no effect. Any insight into what my problem is would be great.
1)Lower your AVD Memory if it set to default try running below 600 MB RAM
2) Try reinstalling the Emulator sdk
This can be solved by the following step:
Please ensure "Windows Hypervisor Platform" is installed. If it's not installed, install it, restart your computer and you will be good to go.

Could not open avd_name.avd/cache.img

When i run emulator, i get the following error:
Cannot launch AVD in emulator.
Output:
Hax is enabled
qemu-system-x86_64.exe: -drive if=none,index=1,id=cache,file={path_to_SDK}\SDK.android\avd{AVD_name}.avd/cache.img: could not open disk image {path_to_SDK}\SDK.android\avd{AVD_name}.avd/cache.img:
Could not open '{path_to_SDK}\SDK.android\avd{AVD_name}.avd/cache.img':
Invalid argument
Hax ram_size 0x40000000
HAX is working and emulator runs in fast virt mode.
Error accepting connection, aborting
AVD specs are:
OS: Android 6.0 Google APIs
RAM: 1GB
Resolution: 1440x2560
Running on Android Studio 2.0 Beta 6, Windows 10.
Keep an eye out for a background qemu-system-i386.exe process running in the background that will be locking the cache.img file.
This might be still running from a previously failed emulator launch. Kill that using Task Manager and start again.
I had the same problem already twice since I upgraded to Android Studio 2.0 on Windows 10. I use a preferred emulator in the Run/Debug configuration. Changing the Deployment Target Options in the configuration to Target: Show Device Chooser Dialog solved it for me. After choosing the same emulator instance in the dialog it started with no problem. Then I change back to the preferred emulator setting. Until the next time it breaks...
Hoping this helps.
I faced the same problem in Windows 10.
Clearing temp and %temp% folder followed by a restart of machine solved my problem.
I had this problem, when I didn't notice that emulator is already running :)

USB device exceeds power limits

OK, the android studio really drive me crazy.
At first, AVD cannot launch and I have post my issue here to AVD not running and failed to create new virtual device Throwable: Failed to create the SD card
After install Android SDK Tool from sdk manager and HAXM installer, it finally can lunch but emulator cannot start up.
After I increase the emulator memory, my emulator works fine but I cannot use real device to run my project.
Error: Power Surge On Hub Port: A USB device has exceeded the power
limits of its hub port
I'm not sure whether the error exists is due to the emulator setting because it can run before the emulator memory get increased. Anyone can help? It totally frustrating.
Try restart your system. I faced the same issue before, but it solved after I restart my system.
This happened because I select TB in emulator setting. After change to MB and restart the system again, it solved

Android studio unable to view avd

hi im new to to android studio and programming.
i wrote a simple hello world program, when i click on run and select the default avd device it gives me the following error
"D:\Users\Brian Fernandes\AppData\Local\Android\sdk\tools\emulator.exe" -avd Nexus_5_API_21_x86 -netspeed full -netdelay none
emulator: WARNING: Requested RAM size of 1536MB is too large for your environment, and is reduced to 1152MB.
Cannot set up guest memory 'android_arm': Invalid argument
Error accepting connection, aborting
i reduced the ram now i get the below error
Cannot launch AVD in emulator.
Output:
emulator: ERROR: x86 emulation currently requires hardware acceleration!
Please ensure Intel HAXM is properly installed and usable.
CPU acceleration status: HAX kernel module is not installed!
i have installed haxm yet its giving me this error
Help me resolve the error.
First reduce the size used by this emulator, or try to use an other emulator system image with minimal config to test your Hello Android application.
I advice you to use an Android powered device later when you get ready and when u're a ninja android developer :)
Personally I've had a lot of problems with AVD emulators. I'd try out genymotion as an alternative. https://www.genymotion.com/#!/ This is what I use for all my android development and it's never given me any errors and is faster than avd.
Reduce the RAM for emulator in between 512 MB to 1 GB.
In a Windows environment you cannot use more than 1 GB of ram for emulator.

Android Emulator Issue

Whenever I am running my Android application in Android Studio , I am not getting output on my AVD , instead I am getting error in consle
emulator: device fd:680
HAX is not working and emulator runs in emulation mode
emulator: The memory needed by this VM exceeds the driver limit.
creating window 43 59 329 583
emulator: emulator window was out of view and was recentered
One more issue is whenever I am running application in my phone after the execution of 2nd or 3rd application I am getting error that
unfortunately app has stopped
Assuming you have downloaded HAXM using AVD Manager or manually from any website.
While installing intelhaxm_android.exe(C:\Users\Username\AppData\Local\Android\sdk\extras\intel\Hardware_Accelerated_Execution_Manager) put the RAM space allocation to default which may be 2GB.
I was facing the same problem but it worked after re-installing with 2GB RAM space instead of 1GB which I initially selected. For complete guidance you can refer to: https://software.intel.com/en-us/android/articles/installation-instructions-for-intel-hardware-accelerated-execution-manager-windows

Categories

Resources