2012-08-13 117 views
0

我更新了我的android sdk,但是当我创建一个新的应用程序时,我得到了我从未见过的新选项。 enter image description here更新Android sdk使错误

这是什么意思。 我给一个名字到这个父活动,但是当我运行该应用程序我得到这个错误

No Launcher activity found! 
The launch will only sync the application package on the device! 

完整的控制台输出

[2012-08-13 13:54:35 - GG] ------------------------------ 
[2012-08-13 13:54:35 - GG] Android Launch! 
[2012-08-13 13:54:35 - GG] adb is running normally. 
[2012-08-13 13:54:35 - GG] No Launcher activity found! 
[2012-08-13 13:54:35 - GG] The launch will only sync the application package on the device! 
[2012-08-13 13:54:35 - GG] Performing sync 
[2012-08-13 13:54:35 - GG] Automatic Target Mode: launching new emulator with compatible AVD 'Androidvirtual' 
[2012-08-13 13:54:35 - GG] Launching a new emulator with Virtual Device 'Androidvirtual' 
[2012-08-13 13:54:35 - GG] ------------------------------ 
[2012-08-13 13:54:35 - GG] Android Launch! 
[2012-08-13 13:54:35 - GG] adb is running normally. 
[2012-08-13 13:54:35 - GG] No Launcher activity found! 
[2012-08-13 13:54:35 - GG] The launch will only sync the application package on the device! 
[2012-08-13 13:54:35 - GG] Performing sync 
[2012-08-13 13:54:35 - GG] Automatic Target Mode: launching new emulator with compatible AVD 'Androidvirtual' 
[2012-08-13 13:54:35 - GG] Launching a new emulator with Virtual Device 'Androidvirtual' 
[2012-08-13 13:54:48 - Emulator] WARNING: Data partition already in use. Changes will not persist! 
[2012-08-13 13:54:50 - Emulator] WARNING: SD Card image already in use: /home/belkacem/.android/avd/Androidvirtual.avd/sdcard.img 
[2012-08-13 13:54:50 - GG] New emulator found: emulator-5554 
[2012-08-13 13:54:50 - GG] Waiting for HOME ('android.process.acore') to be launched... 
[2012-08-13 13:54:51 - Emulator] WARNING: Cache partition already in use. Changes will not persist! 
[2012-08-13 13:54:51 - GG] New emulator found: emulator-5556 
[2012-08-13 13:54:51 - GG] Waiting for HOME ('android.process.acore') to be launched... 
[2012-08-13 13:55:18 - Emulator] Failed to create Context 0x3005 
[2012-08-13 13:55:18 - Emulator] emulator: WARNING: Could not initialize OpenglES emulation, using software renderer. 
[2012-08-13 13:55:18 - GG] emulator-5556 disconnected! Cancelling 'sync'! 
[2012-08-13 13:55:20 - Emulator] Failed to create Context 0x3005 
[2012-08-13 13:55:20 - Emulator] emulator: WARNING: Could not initialize OpenglES emulation, using software renderer. 
[2012-08-13 13:55:20 - GG] emulator-5554 disconnected! Cancelling 'sync'! 

的manifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="main.java" 
    android:versionCode="1" 
    android:versionName="1.0" > 

    <uses-sdk 
     android:minSdkVersion="16" 
     android:targetSdkVersion="15" /> 

    <application 
     android:icon="@drawable/ic_launcher" 
     android:label="@string/app_name" 
     android:theme="@style/AppTheme" > 
     <activity 
      android:name=".MainActivity" 
      android:label="@string/title_activity_main" > 
      <meta-data 
       android:name="android.support.PARENT_ACTIVITY" 
       android:value="d" /> 
     </activity> 
    </application> 

</manifest> 

回答

1
No Launcher activity found! 

您的清单文件必须具有一项作为应用启动器的活动...

<activity 
android:name=".MainActivity" 
android:label="@string/title_activity_main" > 

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

</activity> 
+0

但在之前更新Android SDK中,我没有运行任何添加活性应用启动 – user1344201 2012-08-13 12:27:21

1

我认为你需要定义一个启动活动。

<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="main.java" 
    android:versionCode="1" 
    android:versionName="1.0" > 

    <uses-sdk 
     android:minSdkVersion="16" 
     android:targetSdkVersion="15" /> 

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

</manifest> 
1

在您的活动标记中插入<category android:name="android.intent.category.LAUNCHER" />,这将会照顾我所猜测的问题。

+0

但在之前更新Android SDK中的应用程序,我没有运行任何添加作为活动应用启动器中的应用 – user1344201 2012-08-13 12:27:46