I am trying to run my application in htc device (Android 2.2.1 version). But it is displaying the error message as Installation error: INSTALL_FAILED_MEDIA_UNAVAILABLE
. Also my apk size is 7mb. How can I run my app?

- 14,146
- 11
- 55
- 70

- 467
- 2
- 10
- 28
-
Have you seen this: http://stackoverflow.com/q/4709137/450534? – Siddharth Lele Feb 25 '13 at 05:30
-
Add in your manifest : android:installLocation="preferExternal" – Manish Dubey Feb 25 '13 at 05:33
4 Answers
for me it was working fine and all of a sudden this error started coming. Freeing some memory in the phone solved my issue .

- 4,368
- 7
- 69
- 118
It's can be because of low memory. For me problem solved when delete some unnecessary files and apps.

- 758
- 6
- 16
Is your phone connected through USB. If so, its not able to mount your sdcard. The issue might be cos of the flag android:installLocation:"preferExternal" so that the app is installed in the SDCard. Try to copy the apk file to your sdcard using DDMS or file explorer mode and then, remove the USB and install the file through the device file browser app.

- 2,076
- 2
- 15
- 17
This problem can arise when the install location is specified and rigid. You can use following in your android manifest for specify install location for your test app.
android:installLocation="preferExternal"
to install the app in your external memory. eg. SD Cards
android:installLocation="preferInternal"
to install the app in your external memory. eg. your phone's internal memory
android:installLocation="auto"
to install the app whereever the device recons fit. Using this solved my problem .
Good luck

- 16,144
- 26
- 115
- 161

- 73
- 1
- 10
-
There is no such `preferInternal` option, but you can use `internalOnly`. See the [Android Developer Docu](https://developer.android.com/guide/topics/manifest/manifest-element.html#install) – Johnson_145 Apr 12 '18 at 13:52