简体   繁体   中英

Android - Failed to install apk on physical device but successful on emulator

I've tried multiple times to install the apk on the physical device using eclipse but i keep getting this error

[2012-07-20 11:26:23 - SRD-Android] Failed to install SRD-Android.apk on device '1000fa6e2581!
[2012-07-20 11:26:23 - SRD-Android] (null)
[2012-07-20 11:26:23 - SRD-Android] Launch canceled!

It works perfectly fine on the emulator. Is this because the android application is built against Google APIs [Android 2.2]? But the physical device itself is Android 2.2 as well.

Manifest file:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.srd.application"
    android:versionCode="1"
    android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="7"
    android:targetSdkVersion="14" />
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION"></uses-permission>

   <application
    android:label="@string/app_name"
    android:theme="@android:style/Theme.Light"
 >
     <uses-library android:name="com.google.android.maps" />

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

    </activity>
    <activity android:name=".ElderHome"></activity>
    <activity android:name=".AddEventRel"></activity>
</application>

尝试禁用调试器(设置>应用程序>开发> USB调试),然后重新启用它,看看是否有帮助。

Add below into Manifest.xml

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

Then.. It works well :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM