您的位置:首页 > 移动开发 > Android开发

Android程序调试时出现的两个问题

2012-10-08 10:37 369 查看
今天调试程序时出现了两个问题,找了一下解决方法记录下来

1、No Launcher activity found!错误

android工程跑程序时显示No Launcher activity found错误,模拟器也不运行。

上网一查,发现问题出在整个项目的那个主配置xml中,一般名字都是叫AndroidManifest.xml

里面没有配置启动项(原因多种多样),在<application></application>中少了这段代码

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

<intent-filter>

<action android:name="android.intent.action.MAIN" />

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

</intent-filter>

</activity>

其中.MainActivity就是你的项目的主Activity

 

2、Re-installation failed due to different application signatures.

 

2011-10-31 13:25:00 - MyAndroid] Re-installation failed due to different application signatures.

[2011-10-31 13:25:00 - MyAndroid] You must perform a full uninstall of the application. WARNING: This will remove the application data!

[2011-10-31 13:25:00 - MyAndroid] Please execute 'adb uninstall com.test' in a shell.

[2011-10-31 13:25:00 - MyAndroid] Launch canceled!

 
 

原因是已经存在一个程序签名了,必须删除一个。

解决方法:在cmd命令窗口中进入adb.exe所在的路径,执行: adb uninstall com.test命令就可以了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  android application cmd xml
相关文章推荐