如果在运行/调试配置中,如果我指定启动活动,那么我的应用运行良好,但是当选择“启动默认活动”时,我会得到“No Launcher activity found!”尽管我已经在清单文件中指定了启动活动,但仍然出现了来自android adb的错误。我正在使用android 2.1。Android清单文件未拾取默认启动活动
我试过刷新文件/项目,清理并重建,删除文件并重写它,创建一个新项目并复制/粘贴所有代码并执行Android工具 - >修复项目属性。我试过Android工具 - >重命名应用程序包,它提示我更新项目启动配置(我说是的,但它仍然不能解决问题)。
我也试过不同的设备。我的主页活动扩展了另一个活动,并位于我的src文件夹中的Home.java文件中。这是我的manifest文件的样子:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.geogreenweb.localvore"
android:versionCode="1"
android:versionName="1.0">
<application
android:icon="@drawable/icon"
android:label="@string/general_app_name"
android:debuggable="true">
<meta-data android:name="android.app.default_searchable"
android:value=".localvorebeta6" />
<activity android:name="com.geogreenweb.localvore.Home"
android:label="@string/general_app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data android:name="android.app.searchable"
android:resource="@xml/searchable"/>
</activity>
<activity android:name="com.geogreenweb.localvore.Quit"
android:label="Quit">
</activity>
<activity android:name="com.geogreenweb.localvore.InSeason"
android:label="In Season">
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data android:name="android.app.searchable"
android:resource="@xml/searchable"/>
</activity>
<activity android:name="com.geogreenweb.localvore.List"
android:label="A - Z">
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data android:name="android.app.searchable"
android:resource="@xml/searchable"/>
</activity>
<activity android:name="com.geogreenweb.localvore.Local"
android:label="Local"
android:configChanges="orientation"
android:windowSoftInputMode="stateHidden">
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data android:name="android.app.searchable"
android:resource="@xml/searchable"/>
</activity>
<activity android:name="com.geogreenweb.localvore.Details"
android:label="Details">
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data android:name="android.app.searchable"
android:resource="@xml/searchable"/>
</activity>
<activity android:name="com.geogreenweb.localvore.Search"
android:label="Search">
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data android:name="android.app.searchable"
android:resource="@xml/searchable"/>
</activity>
<activity android:name="com.geogreenweb.localvore.Map"
android:label="Map"
android:windowSoftInputMode="stateHidden">
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data android:name="android.app.searchable"
android:resource="@xml/searchable"/>
</activity>
<activity android:name="com.geogreenweb.localvore.Help"
android:label="Help">
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data android:name="android.app.searchable"
android:resource="@xml/searchable"/>
</activity>
</application>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-sdk android:minSdkVersion="7" />
</manifest>
更新:我改变了活动标签之一,而不同的标签出现在应用程序,所以更改清单文件正在回升,但还是我获取不启动活动错误
更新2:我设法通过最终创建一个新项目来解决问题,但只有在选择创建新项目时创建活动的选项,然后复制/粘贴到其余的东西纳入项目
我应该补充说,当我更改并保存清单文件时,我可以看到eclipse(重新)在后台构建项目。但是,它没有给我“启动配置更新”对话框:http://img855.imageshack.us/img855/2448/launchconfigchanges.png(仅当我尝试更改软件包名称时出现,如上例所示) –