[英]Android emulator not loading an app
每當我嘗試在Android模擬器上運行應用程序時,都會從adt捆綁包中的日食加載該模擬器,並且控制台會輸出以下內容:
[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!
您是否通過進入菜單檢查了您的應用程序是否已安裝?
因為如果您忘記將活動作為啟動程序活動,則您的應用程序將不會彈出,並且您可能不會注意到您的應用程序已經安裝。
您可以通過以下給定的標簽將該活動作為清單中的啟動器:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.LAUNCHER" />
我認為您似乎在針對應用程序的主要活動的清單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>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.