Anish Shrestha
Anish Shrestha

Reputation: 11

Emulator Not Starting-up in Android Studio: The emulator process for AVD has terminated

I am a beginner working with Android Studio and am encountering an issue when attempting to launch an emulator. Despite multiple troubleshooting attempts—including reinstalling Android Studio across different versions, restarting my PC, performing cold boots, wiping the emulator's data, and creating emulators for multiple devices with different API levels—the same error consistently occurs, regardless of the emulator configuration.

Error while trying to start-up the emulator: Error during emulator starting-up

The error log in C:\Users{user_name}\AppData\Local\Google\AndroidStudio{version}\log\idea.txt shows the following entries:

2024-11-13 10:54:06,796 [  14130]   INFO - Emulator: Pixel 3a - Process finished with exit code -1073741819 (0xC0000005)
2024-11-13 10:54:06,796 [  14130]   WARN - Emulator: Pixel 3a - Emulator terminated with exit code -1073741819

It appears the emulator process is terminating unexpectedly with exit code -1073741819 (0xC0000005). My device has adequate storage space.

Could anyone provide guidance on resolving this error?

TRIED:

EXPECTED:

ACTUALLY RESULTED:

UPDATE: Running emulator as ```PS C:\Users\{user_name}\AppData\Local\Android\Sdk\emulator> ./emulator -gpu off -avd Pixel_3a``` runs the emulator but won't open up directly through android studio, which is the main problem for me. Also, additional information if required, the graphics acceleration is set to automatic by default and is grayed out ( I can't change it). If other options is set to gpu like host, then it will crash like:

PS C:\Users\{user_name}\Desktop> C:\Users\{user_name}\AppData\Local\Android\Sdk\emulator/emulator -gpu host -avd Pixel_3a
INFO         | Android emulator version 35.4.1.0 (build_id 12623485) (CL:N/A)
INFO         | Graphics backend: gfxstream
INFO         | Found systemPath C:\Users\{user_name}\AppData\Local\Android\Sdk\system-images\android-30\google_apis_playstore\x86\
INFO         | Found systemPath C:\Users\{user_name}\AppData\Local\Android\Sdk\system-images\android-30\google_apis_playstore\x86\
WARNING      | Please update the emulator to one that supports the feature(s): Vulkan
INFO         | IPv4 server found: ....
INFO         | Ignore IPv6 address: ....
INFO         | Ignore IPv6 address: ....
INFO         | Checking system compatibility:
INFO         |   Checking: hasSufficientDiskSpace
INFO         |      Ok: Disk space requirements to run avd: `Pixel_3a` are met
INFO         |   Checking: hasSufficientHwGpu
INFO         |      Ok: Hardware GPU requirements to run avd: `Pixel_3a` are passed
INFO         |   Checking: hasSufficientSystem
INFO         |      Ok: System requirements to run avd: `Pixel_3a` are met
WARNING      | FeatureControl is requesting a non existing feature.
INFO         | Warning:
INFO         | Warning:
INFO         | Storing crashdata in: C:\Users\{user_name}\AppData\Local\Temp\\AndroidEmulator\emu-crash-35.4.1.db, detection is enabled for process: 8128
INFO         | Crash reports will be automatically uploaded to: https://clients2.google.com/cr/report
library_mode host gpu mode host
PS C:\Users\{user_name}\Desktop>

I have vulkan-1.dll file in both path C:\Windows\System32 and *{ANDROID_HOME}\emulator\lib64* as stated here.

Upvotes: 1

Views: 313

Answers (1)

Darshan Parmar
Darshan Parmar

Reputation: 1

Solutions

Try these solutions in order, as they progress from simple to more complex fixes:

1. GPU Configuration Fix

# Run emulator with GPU off
cd %ANDROID_HOME%/emulator
./emulator -gpu off -avd YOUR_AVD_NAME

Or modify the AVD configuration:

  1. Open AVD Manager
  2. Click 'Edit' (pencil icon) for your AVD
  3. Show Advanced Settings
  4. Under Emulated Performance:
    • Graphics: Select 'Software - GLES 2.0'
    • Change 'Enable GPU acceleration' to off

2. Update Graphics Drivers

  1. Install/Update GPU drivers
  2. For NVIDIA users:
    Control Panel → 3D Settings → Program Settings
    Add Android Emulator and set:
    - OpenGL rendering: Force software
    - Power management: Prefer maximum performance
    

3. Fix Environment Variables

# Add these to System Variables
ANDROID_HOME=C:\Users\[username]\AppData\Local\Android\Sdk
JAVA_HOME=C:\Program Files\Microsoft\jdk-17.0.8.7-hotspot\
Path=%Path%;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools;%ANDROID_HOME%\emulator

4. Clear AVD Data and Cache

# Windows PowerShell commands
Remove-Item -Recurse -Force "${env:USERPROFILE}\.android\avd\*"
Remove-Item -Recurse -Force "${env:LOCALAPPDATA}\Android\Sdk\system-images\*"

# Reinstall system images
sdkmanager --install "system-images;android-30;google_apis_playstore;x86"

5. Create New AVD with Specific Settings

# Create AVD via command line with optimal settings
avdmanager create avd -n "Pixel_3a_API_30" \
    -k "system-images;android-30;google_apis_playstore;x86" \
    -d "pixel_3a" \
    --force

# Edit config.ini
notepad %USERPROFILE%\.android\avd\Pixel_3a_API_30.avd\config.ini

Add these lines to config.ini:

hw.gpu.enabled=yes
hw.gpu.mode=off
disk.dataPartition.size=6442450944

6. Modify Studio Configuration

Edit studio64.exe.vmoptions:

# Location: %APPDATA%\Google\AndroidStudio[version]\studio64.exe.vmoptions
-Xmx2048m
-XX:MaxPermSize=512m
-XX:ReservedCodeCacheSize=240m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-Djdk.http.auth.tunneling.disabledSchemes=""
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow

Advanced Solutions

1. HAXM Installation Fix

# Uninstall existing HAXM
cd %ANDROID_HOME%\extras\intel\Hardware_Accelerated_Execution_Manager
silent_install.bat -u

# Download latest HAXM
# Install with custom settings
silent_install.bat -log -m 2048

2. Windows Hypervisor Fix

# PowerShell (Admin)
# Enable Hyper-V
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All

# OR Disable if using HAXM
Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All

3. Vulkan Support Check

# Check Vulkan installation
Get-ChildItem -Path C:\Windows\System32\vulkan* -File
Get-ChildItem -Path C:\Windows\SysWOW64\vulkan* -File

If missing:

  1. Download Vulkan SDK
  2. Install Graphics drivers with Vulkan support
  3. Add to PATH:
C:\VulkanSDK\[version]\Bin

Prevention Tips

  1. Regular Maintenance
# Clean Android Studio
File → Invalidate Caches / Restart

# Update SDK Tools
sdkmanager --update
  1. Performance Settings
<!-- In gradle.properties -->
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m
org.gradle.parallel=true
org.gradle.daemon=true
  1. Monitoring
# Check emulator process
tasklist | findstr "qemu"
# Monitor GPU usage
nvidia-smi -l 1

Troubleshooting Steps

If issues persist:

  1. Check System Requirements
# PowerShell
systeminfo | Select-String "Total Physical Memory","Processor","OS Name"
  1. Verify Virtualization
# Command Prompt (Admin)
systeminfo | findstr /i "Virtualization"
  1. Log Analysis
# Check emulator logs
type %USERPROFILE%\.android\avd\*.log
  1. Clean Installation
# Remove Android Studio completely
Remove-Item -Recurse -Force "${env:LOCALAPPDATA}\Google\AndroidStudio*"
Remove-Item -Recurse -Force "${env:APPDATA}\Google\AndroidStudio*"

Remember to:

  • Back up your projects before major changes
  • Keep Android Studio and SDK tools updated
  • Monitor system resources during emulator use
  • Use appropriate API levels for your development needs

Would you like me to explain any specific part in more detail?

Upvotes: 0

Related Questions