【问题标题】:Android emulator not loading an appAndroid模拟器不加载应用程序
【发布时间】:2013-06-17 13:39:15
【问题描述】:

每当我尝试在 Android 模拟器上运行应用程序时,从 adt 包中的 eclipse 中,模拟器会加载并且控制台会输出以下内容:

[2013-06-18 06:34:02 - Counter] No Launcher activity found!
[2013-06-18 06:34:02 - Counter] The launch will only sync the application package on the device!
[2013-06-18 06:34:02 - Counter] Performing sync
[2013-06-18 06:34:02 - Counter] Automatic Target Mode: launching new emulator with compatible AVD 'Anroid_emulator'
[2013-06-18 06:34:02 - Counter] Launching a new emulator with Virtual Device 'Anroid_emulator'
[2013-06-18 06:34:03 - Counter] New emulator found: emulator-5554
[2013-06-18 06:34:03 - Counter] Waiting for HOME ('android.process.acore') to be launched...
[2013-06-18 06:34:37 - Counter] HOME is up on device 'emulator-5554'
[2013-06-18 06:34:37 - Counter] Uploading Counter.apk onto device 'emulator-5554'
[2013-06-18 06:34:37 - Counter] Installing Counter.apk...
[2013-06-18 06:35:12 - Counter] Success!
[2013-06-18 06:35:12 - Counter] \Counter\bin\Counter.apk installed on device
[2013-06-18 06:35:12 - Counter] Done!

【问题讨论】:

  • 你能发布你的主要内容吗?

标签: android android-emulator emulation


【解决方案1】:

您是否通过进入菜单检查了您的应用是否已安装?

因为如果您忘记将您的活动设置为启动器活动,您的应用将不会弹出,您可能不会注意到您的应用已经安装。

您可以通过以下给定标签将该活动作为清单中的启动器:

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

<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.LAUNCHER" />

【讨论】:

    【解决方案2】:

    我认为您似乎在作为应用程序主要的 Activity 的清单 XML 中缺少这些:

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

    例如,如果你的主要活动被称为MainActivity,它应该是这样的:

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/FooDzines" >
        <activity
            android:name="MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
    
                <category android:name="android.intent.category.HOME" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        ....
        ....
    </application>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多