An SD card (created in AVD) is displayed as โ€œdeletedโ€ in the emulator for Android Studio

I created a virtual device with an SD card (AVD Manager-> Edit device-> Advanced Settings), but my application still shows that it is missing:

//This prints: External: removed Log.d(TAG, "External: " + Environment.getExternalStorageState() ); 

How do I make external storage work?

I use:

Android Studio 0.8.14 Device: Nexus 5, 4.4 KitKat, CPU: x86

+6
source share
1 answer

In addition to creating the image for the SD card in AVD Manager, you also need to edit the configuration file (this is an error).

Find the emulator configuration in the home directory:

 #Located in: ~/.android/avd/<The_Device_Name>/config.ini 

For example, on Nexus 5 (created by Android Studio) it was:

 ~/.android/avd/Nexus5.avd/config.ini 

Change the setting below:

 hw.sdCard=yes 
+9
source

Source: https://habr.com/ru/post/978658/


All Articles