0

我更新了我的 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'!

清单.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>
4

3 回答 3

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>
于 2012-08-13T12:08:52.067 回答
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>
于 2012-08-13T12:14:47.507 回答
1

插入<category android:name="android.intent.category.LAUNCHER" />您的活动标签,我猜这将解决问题。

于 2012-08-13T12:15:37.143 回答