AVD errors with HAX on Android Studio 2.1 - android

I have a Lenovo W540 Thinkpad with Windows 7 and 8 Gb ram.
I had an old version of Android Studio installed on C:
Since C: was small and have little space left, I uninstalled it, downloaded and installed Android Studio 2.1 on D:
Wanted to run Instrumentation test sample in the emulator.
(https://github.com/googlesamples/android-testing/tree/master/unit/BasicUnitAndroidTest)
Created a default Nexus 5X AVD. Tried to run.
Constantly get AVD errors. Tried setting the memory sizes manually but to no avail.
Do I need to uninstall HAX and reinstall on D:? (is it even possible)
Cannot launch AVD in emulator. Output: Hax is enabled Warning:
requested ram_size 1024M too big, reduced to 512M
qemu-system-x86_64.exe: -drive
if=none,index=1,id=cache,file=C:\Users\aphilip.android\avd\Nexus_5X_API_22_1.avd/cache.img:
could not open disk image
C:\Users\my.android\avd\Nexus_5X_API_22_1.avd/cache.img: Could
not open
'C:\Users\my.android\avd\Nexus_5X_API_22_1.avd/cache.img':
Invalid argument
Update:
It works now after
I created environment variable in Computer|Properties ANDROID_SDK_HOME=D:\
Deleted HAXM and reinstalled
moved .android to D:

It works now after
I created environment variable in Computer|Properties ANDROID_SDK_HOME=D:\
Deleted HAXM and reinstalled
moved .android to D:

Related

Black Screen with Android Emulator

I am a newbie to android development and am running Ubuntu Linux with an AMD cpu. I installed Android Studio, JDK, SDK, etc, and have been trying to run the emulator. However, whenever I try launching the emulator, it stays a black screen. The message I repeatedly get in terminal is
WARN - run.EmulatorConnectionListener - Emulator not ready yet, dev.bootcomplete = null
I have tried waiting for a while, I have tried updating it, I have tried different APIs, I have tried setting emulated performance to software, and everything else I could find online. Help would be greatly appreciated!
Specs:
Ubuntu 16.04 LTS
Android Studio 2.3.3
Radeon R9 270x 4gb
AMD FX4100
32g ram
SVM is enabled in BIOS
This happened to me recently (emulator with black screen, with all AVDs, even those which worked previously), maybe after some system or Android SDK updates.
How I fixed it:
delete whole .android directory (is in your home directory) - backup this directory before deleting (it contains your AVDs, your debug signing key or other things you might wish to return to later) - yes, this was the thing that really helped
create new AVD - you have to do this after deleting that .android directory (it did not work if I copied backed up AVD back there)
For reference, here is AVD configuration which works for me now (created directly using Android SDK, not using the wizard in Android Studio):
Device: Nexus One (3.7", 480 x 800: hdpi)
Target: Android 7.0 - API Level 24
CPU/ABI: Intel Atom (x86_64)
Keyboard: [x] Hardware keyboard present
Skin: Skin with dynamic hardware controls
Front Camera: None
Back Camera: None
RAM: 1024
VM Heap: 64
Internal Storage: 200 MiB
SD Card: (empty)
[ ] Snapshot (unchecked)
[ ] Use Host GPU (unchecked)

ERROR: resizing partition e2fsck failed with exit code 8

I'm new to android studio. When I try to run my first programme in android studio on the emulator, I get this error.
I have searched through other comments and have also tried decreasing my build.gradle from 24.0.0 to 23.0.3 as shown below, but it still doesn't work. I'm running on Nexus 5X API 23.
android {
compileSdkVersion 24
buildToolsVersion "23.0.3"
}
The error shown is:
Cannot launch AVD in emulator.
Output:
emulator: WARNING: userdata partition is resized from 756 M to 800 M ERROR: resizing partition e2fsck failed with exit code 8
Hax is enabled
Hax ram_size 0x60000000
HAX is working and emulator runs in fast virt mode.
emulator: Listening for console connections on port: 5554
emulator: Serial number of this emulator (for ADB): emulator-5554
I had the same issue after updating Android SDK tools package to version 25.2.2. To fix the problem i've restarted Android SDK Manager and then created new virtual device instead of using the old one.
I know this is an "old" question, but the following command solved the problem for me:
./emulator -data /sdk/path/here/system-images/android-API/default/x86/userdata.img -avd your_avd_name
where API is the api level you want to use. I found that this is only needed for API<20
Note: I had that problem with libstdc++, so I had to use the LD_PRELOAD envvar. I removed it in the example, so for me, the complete command looks like this:
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6 ./emulator -data /home/username/Android/Sdk/system-images/android-API/default/x86/userdata.img -avd Whatever
I ran into the same type of problem after installing an update to one the SDK platforms, except my output log contained more than complaints. It contained a possible solution to the problem. See the log below.
emulator: WARNING: userdata partition is resized from 769 M to 770 MERROR: resizing partition e2fsck failed with exit code 8
Hax is enabled
Hax ram_size 0x40000000
HAX is working and emulator runs in fast virt mode.
emulator: Listening for console connections on port: 5554
emulator: Serial number of this emulator (for ADB): emulator-5554
Your emulator is out of date, please update by launching Android Studio:
- Start Android Studio
- Select menu "Tools > Android > SDK Manager"
- Click "SDK Tools" tab
- Check "Android SDK Tools" checkbox
- Click "OK"
Emulator Android_Accelerated_x86_Nougat is running.
Waiting for emulator to be ready...
Solution 1: Update the SDK Tools
Open Android SDKs and Tools window.
Go to the Tools tab (the name of this tab has changed).
Expand the Android SDK Tools group and make sure you select the
latest available version.
Click Apply Changes.
Possible problem with this solution:
You may run into a new problem by following this solution. When you run the emulator it will do a cold boot and ask you for a decryption password. If you don't provide the right password, it will display a black screen and then tell you that the decryption failed.
So this did not work in my case, but your mileage may vary.
Solution 2: Factory reset the emulator
I don't use Android Studio. I use Xamarin with Visual Studio. Installing the Xamarin Device Manager and doing a factory reset of the emulator is what fixed the problem for me.
You should have a similar option if you are using Android Studio. But if you would like to, you can try downloading and installing the Xamarin Device Manager by Microsoft. It's an independent application that does not require installation of Visual Studio or Xamarin.
The misleading ERROR: resizing partition e2fsck failed with exit code 8 when starting an Android Virtual Device (AVD) can occur when you have an old version of Android SDK installed, but without the Android Studio. The old standalone graphical SDK Manager is deprecated as of SDK Tools v25.2.3 - running it does not report any errors, but does not properly update your Android SDK.
Use the new command line SDK Manager ./sdkmanager --update to properly update your Android SDK and the e2fsck failed with exit code 8 problem will be gone.
More information: How to update Android emulator without Android Studio?
WARNING: userdata partition is resized from 756 M to 800 M
For this warning set Internal Storage = 756 MB
error warning will be removed.
Change disk.dataPartition.size to 756M in:
~/.android/avd/your_avd_name.avd/config.ini
I had the same issue, and tried everything that is suggested above, without success.
Being desperate, I tried every menu I could find in AVD. So, I came on "show on disk" menu, at the right of the line of my device, in AVD device list.
Android Studio opened an explorer window, and showed me a directory with a name not matching my device name... Probably because I had renamed my device in AVD, and Android Studio had not reported this change on disk.
So I deleted my device, created a new one with same parameters, verified that directory and name matched, and launched the device... and it worked!!!
Hope this will be helpfull to anyone...
None of the answers here solved my issue, but I did find this after searching for a while and it solved my issue. If all else fails, check out the answer here:
Emulator: ERROR: resizing partition e2fsck failed with exit code 1

Android - emulator-x86.exe has stopped working

My problem : I am using a less speed internet so when i reinstalled my windows 8.I Copied the sdk and .android folder to avoid installing updates.I installed the fresh android studio and linked the sdk and .android folder using environment variables.
When i tried to run my android app it shows the error "emulator-x86.exe has stopped working"
In event log : D:\android\sdk\tools\emulator.exe -netdelay none -netspeed full -avd Nexus_5_API_23
Note: The environment variable $ANDROID_SDK_HOME is set, and the emulator uses that variable to locate AVDs.
This may result in the emulator failing to start if it cannot find the AVDs in the folder pointed to by the
given environment variable.
ANDROID_SDK_HOME=D:\android\sdk
What i Tried :
1. reinstall intel haxm
2. tried low resolutions
3. created new virtual device
4. RAM size reduced to 512 mb
System config:
I refereed the following :
Emulator-x86.exe has stopped working in android studio
emulator-x86.exe has stopped working after lauching
Android studio: emulator-x86.exe stopped working after creating the window for the emulator
emulator-x86.exe has stopped working
By unchecking Use host GPU i solved my problem .. i created a video for the same https://www.youtube.com/watch?v=Bt6QN6-nGEA

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 :)

Cannot get HAX working for Android Emulator & the emulator appears to freeze

I am running OS-X 10.10.2 Yosemite on my MacBook Air and have installed the latest version of the Android Studio (1.2) and it has a default SDK already pre-configured.
I am trying to setup the Intel HAXM to speed up the emulation - I have also setup the Ionic & Cordova frameworks (as i'll be using this to develop mobile apps).
I am using the command to start the emulator:
sudo cordova emulate android
This begins the process and opens up an Android Virtual Device and the 'android' word appears on the screen.
In the Terminal I get the following:
Waiting for emulator....
emulator: The memory needed by this VM exceeds the driver limit
HAX is not working and emulator runs in emulation mode
Booting up emulator (this may take a while)...............................
This appears to 'stick' on this screen - I have installed the Intel HAXM (1.2 is installed) but it doesn't seem to have been correctly configured - can anyone suggest how to fix. I have changed the RAM used by HAXM to 1GB and 768MB with no joy..
Can anyone suggest any ideas?

Categories

Resources