Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
244 views
in Technique[技术] by (71.8m points)

android - Installation error: INSTALL_FAILED_MEDIA_UNAVAILABLE?

When I run an android app from eclipse I meet this error and my app does not start:

Installation error: INSTALL_FAILED_MEDIA_UNAVAILABLE

Please check

logcat output for more details. Launch canceled!

But when I opened logcat, I see that logcat doesn't print anything.

I think that some problem with my manifest file. so here is my manifest file:

android:installLocation="preferExternal">>

<uses-sdk android:minSdkVersion="8" />

<application

    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:debuggable="true" >

    <activity
        android:name=".HelloWorld"
        android:label="Test" >

        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>


    </activity>
</application>

<uses-sdk android:targetSdkVersion="8" android:minSdkVersion="8"/>    
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...