Ubuntu - Error: Failed to create SD card

I see a lot of messages about writing to the SD card, but I think that my problem is different. I cannot create an SD card while creating an AVD.

At first I tried using the Android SDK and AVD Manager by selecting
Name : my_avd
Goal : Android 2.2 - API Level 8
SD card : size: 1024 MiB
Skin : built-in: default (HVGA)
Hardware : property: abstract LCD density, value: 160

This pops up a message box:
"Result of creating AVD" my_avd ":
Error: Failed to create SD card. "

I tried to repeat the process from the command line, getting 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. 

Trying to follow the instructions for using mksdcard was equally futile; I think my main lack of Linux experience may cause me a problem here. When I try to use mksdcard, it simply reports that it cannot find the file or directory. Is the mksdcard tool available for use this way on 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 added the android tools directory to the PATH variable, but I feel that obviously something else is missing for me. Perhaps some access rights?

Trying to run the android command using sudo didn't 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, but to no avail. Any advice would be most valuable. A preliminary warning that I'm a novice Linux user, so even if this seems like an obvious thing to check, I could still skip it.

+83
android linux ubuntu
Oct 07 '10 at 3:24
source share
18 answers

So, I have found a problem. I used a 64-bit Linux installation that did not have the ia32-libs package installed by default. Mksdcard utility will not work without this package. After installing it, I was able to create AVD without problems using the AVD manager.

+101
Oct 08 '10 at 1:33
source share
β€” -

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

 sudo apt-get install lib32stdc++6 
+81
Oct. 20 '16 at 6:35
source share

I had the same error as you, and I just solved it, so maybe this can help you (although I don’t think your error is caused by the same problem as me).

I found that all the tools in the tools .. / tools do not have permission to use, so I used

 chmod -R 777 ../tools 

from the command line and finally works

+22
Apr 28 2018-11-11T00:
source share

As others have already written, the problem is that your Linux distribution is 64-bit, and currently Android Virtual Device ( AVD ) requires the x86 library to work correctly.

Someone suggested installing ia32-libs. However, in Ubuntu 14.04 LTS you will not find this library. I decided to use these alternative libs: lib32z1, lib32ncurses5, lib32bz2-1.0 and lib32stdC ++.

 sudo apt-get update sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++ 
+10
Aug 22 '14 at 15:33
source share

I ran into the same problem. NONE from the SDK tools will run on 64-bit Ubuntu without installing ia32-libs (example: sudo apt-get install ia32-libs).

+6
Dec 15 '10 at 9:10
source share

In elementary OS and ubuntu, the solutions were to install the following packages

 sudo apt-get install lib32ncurses5 lib32z1 sudo apt-get install libgcc1:i386 
+5
Aug 20 '17 at 15:16
source share
 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 found this problem, and I found the first way:

 cd /home/alex/android-sdk-linux_x86/tools/ 

then write this:

 sudo chmod 755 mksdcard mksdcard 1024M ./sdcard.iso sudo android create avd -n my_avd -t 1 -c 1024M 

it should work :)

+4
Feb 09 2018-12-12T00:
source share

If you are using Kali, Debian Jessie (or Ubuntu 13.10+), try

sudo apt-get install lib32stdc ++ 6

instead of the above ia32-lib.

+4
Aug 19 '16 at 2:04 on
source share
 sudo apt-get install lib32stdc++6 

After that, you may receive the following errors

 Cannot launch AVD in emulator. Output: libGL error: unable to load driver: i965_dri.so libGL error: driver pointer missing libGL error: failed to load driver: i965 libGL error: unable to load driver: swrast_dri.so libGL error: failed to load driver: swrast X Error of failed request: GLXBadContext Major opcode of failed request: 154 (GLX) Minor opcode of failed request: 6 (X_GLXIsDirect) Serial number of failed request: 49 Current serial number in output stream: 48 libGL error: unable to load driver: i965_dri.so libGL error: driver pointer missing libGL error: failed to load driver: i965 libGL error: unable to load driver: swrast_dri.so libGL error: failed to load driver: swrast X Error of failed request: GLXBadContext Major opcode of failed request: 154 (GLX) Minor opcode of failed request: 6 (X_GLXIsDirect) Serial number of failed request: 49 Current serial number in output stream: 48 libGL error: unable to load driver: i965_dri.so libGL error: driver pointer missing libGL error: failed to load driver: i965 libGL error: unable to load driver: swrast_dri.so libGL error: failed to load driver: swrast emulator: WARNING: VM heap size set below hardware specified minimum of 228MB X Error of failed request: BadValue (integer parameter out of range for operation) emulator: WARNING: Setting VM heap size to 384MB Major opcode of failed request: 154 (GLX) Minor opcode of failed request: 24 (X_GLXCreateNewContext) Value in failed request: 0x0 Serial number of failed request: 33 Current serial number in output stream: 34 QObject::~QObject: Timers cannot be stopped from another thread 

Use these 3 teams to solve these

 mv ~/Android/Sdk/tools/lib64/libstdc++/libstdc++.so.6{,.bak} mv ~/Android/Sdk/tools/lib64/libstdc++/libstdc++.so.6.0.18{,.bak} ln -s /usr/lib/libstdc++.so ~/Android/Sdk/tools/lib64/libstdc++/** 
+4
Feb 03 '17 at 9:53 on
source share

This problem also occurred, and after installing the i386 package, I managed to create an SD card for my Android emulator. I had to take two steps

 sudo apt-get update sudo apt-get install ia32-libs 

After that I was able to create an emulator with an attached SD card

+3
May 21 '13 at 22:06
source share

I had another problem: platform tools were in my way, but there were no tools. So, it worked, except that the SDCard image was not created. This was not known when I created avd in eclipse, and the virtual device was created with a really small SD card, forcing it to constantly throw an invalid error when installing the application.

+2
Jul 07 '11 at 20:35
source share

I am running Fedora 64 and have the same problem. The information on this page has helped me.

http://iexcel.wordpress.com/2010/01/25/ia32-libs-for-android-sdk-on-fedora-12-x86_64/

+2
Sep 14 '12 at 12:30
source share

When testing debian when I tried to run. / tools / mksdcards, I got an error:

 error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory 

Installing lib32stdC ++ 6 fixes the problem and it was possible to create avd.

+2
Jan 02 '15 at 17:50
source share

I had another problem with 32-bit Ubuntu. When I tried to start mksdcard manually, I got a file that did not find an error.

The problem was open-jre / jdk. I installed oracle java and the problem was fixed. Unfortunately, you can no longer install oracle java through apt / synaptic and must jump through additional hoops:

https://github.com/flexiondotorg/oab-java6

+1
Apr 17 '12 at 18:08
source share

MyOS is Oracle Unbreakable Linux 6 - to solve this problem I had to install the libstdC ++ package - 4.4.6-3.el6.i686.

0
Jun 28 2018-12-12T00:
source share

I had the same problem. After troubleshooting, I found out that because of my Windows 32bit and my mksdcard is only compatible with 64-bit. Then I just copied the 32 bit mksdcard to the tools folder and deleted the old one. He solved my problem.

0
Mar 30 '15 at 13:16
source share

After a lot of installation and no result, I found that it worked.

This is because some executables in sdk/tools cannot be executed. Go to the Android Studio and Android SDK folders and make all directories and files executable with this command:

 chmod +x -R * 
0
Aug 25 '19 at 9:07
source share

Try moving the android sdk folder to your home folder. He works.

-one
Dec 26 '13 at 9:52
source share