When I run an android app from eclipse I meet this error and my app does not start:
Installation error: INSTALL_FAILED_MEDIA_UNAVAILABLE
i solved it by adding the following line to the AndroidManifest.xml file in your app:
android:installLocation="auto"
...it should be like this:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.MyTestApp"
android:installLocation="auto"
My case worked after I deleted some files or apps on the phone. I use an Htc phone I think the phone needs some amount of space to be available on the internal memory, and the amount of space needed varies from phone to phone
cmd
cd
to android sdk folder > platform tools
adb shell
, now a #
sign appearspm set-install-location 1
and another #
appears should work fine with you. Note: The 1
in the pm command signifies that apps will install only on the internal storage. See pm command for more info.
Is your Phone connected via USB? if yes, the SDCard is not mounted. Try to connect your phone in another mode or copy your software apk onto the SDCard, disconnect it from the pc and run the installation. It should work then :-)
For example, my Motorola Defy supports the usb modes "mass storage mode" and "media server" mode. In mass storage mode, the sdcard is unmounted from the device, so you can access it from your pc.
The problem is the "preferExternal" command, which tells Eclipse to try the installation on SDCard. You can also try to erase the installLocation command to install it your app in internal storage.
Greetings!
If none of the fixes above worked for you, like it didn't for me, there's a really simple fix you could consider.
In your USB computer connection settings, uncheck the "Mount SD card" box and leave it only checked at "Media device (MTP)". Then run the app again.
This way your external storage won't be unmounted when you connect your device to your pc and your app will then install successfully
Insert memory card in your phone if not work then root your phone it will definitely work.