Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ubuntu - Error: Failed to create the SD card

I see a lot of posts about writing to the SD card, but I believe my problem is different. I am unable to create the SD card during the process of building an AVD.

I initially tried to use the Android SDK and AVD Manager to do this, selecting
Name: my_avd
Target: Android 2.2 - API Level 8
SD Card: Size: 1024 MiB
Skin: Built-In: Default (HVGA)
Hardware: Property: Abstracted LCD Density, Value: 160

This pops up a window with the message:
"Result of creating AVD 'my_avd':
Error: Failed to create the SD card."

I tried to repeat the process from the command line, receiving a similar error:

alex@alex-desktop:~$ android create avd -n my_avd -t 1 -c 1024M Android 2.2 is a basic Android platform. Do you wish to create a custom hardware profile [no]no Error: Failed to create the SD card. 

Attempting to follow instructions for using mksdcard was equally unproductive; I think my basic lack of linux experience may be causing me a problem here. When I try to use mksdcard, it just reports that it cannot find the file or directory. Is the mksdcard tool available for use this way in linux?

alex@alex-desktop:~$ mksdcard 1024M ./sdcard.iso bash: /home/alex/android-sdk-linux_x86/tools/mksdcard: No such file or directory alex@alex-desktop:~$ sudo android create avd -n my_avd -t 1 -c 1024M 

I've added the android tools directory to my PATH variable, but I feel like there is obviously something else I'm missing. Perhaps some kind of access rights?

Attempting to run the android command with sudo did not seem to help either:

alex@alex-desktop:~/android-sdk-linux_x86/tools$ sudo ./android create avd -n my_avd -t 1 -c 1024M Android 2.2 is a basic Android platform. Do you wish to create a custom hardware profile [no]no Error: Failed to create the SD card. 

I even tried installing Eclipse and the ADT plugin and running the manager from there to no avail. Any tips would be most appreciated. Advanced warning that I am somewhat of a novice Linux user, so even if it seems like a no-brainer obvious thing to check, I could still have missed it.

like image 940
Alex Pritchard Avatar asked Oct 07 '10 03:10

Alex Pritchard


2 Answers

On Ubuntu 16.04 LTS x64, using Android Studio 2.1 (also tested on 2.3.3), run from a terminal:

sudo apt-get install lib32stdc++6 
like image 22
GeekLei Avatar answered Sep 18 '22 14:09

GeekLei


So I found the problem. I was using a 64-bit Linux install, which did not have the ia32-libs package installed by default. The mksdcard utility will not run without this package. After installing it, I was able to build the AVD without a problem using the AVD manager.

like image 137
Alex Pritchard Avatar answered Sep 21 '22 14:09

Alex Pritchard