2011-06-01 99 views
1

我剛剛成立日食根據本http://developer.android.com/sdk/installing.html開始android開發。我的問題似乎與此類似:Android app not launching on emulator,但解決的辦法是行不通的。我正在嘗試運行一個簡單的Hello應用程序。我沒有得到任何錯誤,但這裏是控制檯:Android應用程序不啓動對模擬器

[2011-06-01 10:03:53 - HelloAndroid] ------------------------------ 
[2011-06-01 10:03:53 - HelloAndroid] Android Launch! 
[2011-06-01 10:03:53 - HelloAndroid] adb is running normally. 
[2011-06-01 10:03:53 - HelloAndroid] Performing com.example.helloandroid.HelloAndroid activity launch 
[2011-06-01 10:04:00 - HelloAndroid] Launching a new emulator with Virtual Device 'AVD2.2' 

下面是一些代碼,我有:

package com.example.helloandroid; 

import android.app.Activity; 
import android.os.Bundle; 
import android.widget.TextView; 

public class HelloAndroid extends Activity { 
    /** Called when the activity is first created. */ 
    @Override 
    public void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     TextView tv = new TextView(this); 
     tv.setText("Hello, Android"); 
     setContentView(tv); 
    } 
} 

這裏是清單:

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
     package="com.example.helloandroid" 
     android:versionCode="1" 
     android:versionName="1.0"> 
    <uses-sdk android:minSdkVersion="8" /> 

    <application android:icon="@drawable/icon" android:label="@string/app_name"> 
     <activity android:name=".HelloAndroid" 
        android:label="@string/app_name"> 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 
       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
     </activity> 

    </application> 
</manifest> 

模擬器啓動並進入一個屏幕,我可以解鎖它。模擬器似乎工作,但應用程序從未啓動。此外,當我有模擬器運行和我去嘗試通過單擊運行方式... Android應用程序重新發動應用程序,並彈出對話框詢問我選擇模擬器啓動,正在運行的仿真器沒有顯示。

+0

在仿真器和兼容的代碼的源代碼版本。我注意到代碼需要版本8.你開始使用什麼版本的模擬器? – fleetway76 2011-06-01 15:31:34

+0

2.2它的API級別也是8 – user779608 2011-06-01 15:41:08

+0

根據我的記錄,這是不可能與不當版本號爲仿真器在調試/應用程序運行CONFIGRATION – Gangnus 2011-06-01 15:42:06

回答

6

嘗試在默認情況增加

<category android:name="android.intent.category.DEFAULT" /> 

的Eclipse啓動默認的活動。如果這不起作用,請右鍵單擊該項目,然後檢查運行配置。您可以選擇設置要啓動的活動。

此外,你應該能夠看到該圖標在模擬器啓動應用程序抽屜您的應用程序。點擊該圖標,查看應用是否啓動。如果沒有,那麼問題出現在你的活動中(儘管我沒有看到任何錯誤)。

如果這兩個不工作,嘗試從命令提示符重新啓動亞行:

>adb kill-server 
>adb start-server 
+0

謝謝!反彈服務器做到了。 – user779608 2011-06-01 16:04:45

0

有時在類似的情況清除項目幫助...

有你設置的應用程序名稱的字符串.xml文件?

相關問題