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

Android 应用异常记录

2011-08-30 17:13 260 查看
1、

[2011-08-30 17:10:01 - WebGetter] Starting activity com.snda.webgetter.NotesList on device emulator-5554

[2011-08-30 17:10:02 - WebGetter] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.snda.webgetter/.NotesList }

[2011-08-30 17:10:02 - WebGetter] New package not yet registered with the system. Waiting 3 seconds before next attempt.



解决方案: Try this Project->Clean in eclipse, and the deploy it again



2、批量更新了package的名称,引起AndroidManifest.xml变更

解决方案:去除类似签名的 com.snda.webgetter.test前缀com.snda.webgetter,重新编译



3、修改了AndroidManifest.xml的provider,引起

[2011-08-30 17:31:42 - WebGetter] Installation error: INSTALL_FAILED_CONFLICTING_PROVIDER

[2011-08-30 17:31:42 - WebGetter] Please check logcat output for more details.

[2011-08-30 17:31:42 - WebGetter] Launch canceled!



解决方案:启动模拟器,然后进入菜单

settings->applications->mange

applications-> select the application->select "unistall".

这样就能彻底删除了



4、Activity not started, its current task has been brought to the front

解决方案:project->clean

5、09-11 01:23:27.561: ERROR/AndroidRuntime(319): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.snda.webgetter/com.snda.webgetter.peferences.WebGetterPreferenceActivity};
have you declared this activity in your AndroidManifest.xml?

如果WebGetterPreferenceActivity与主界面WebGetterActivity在一个目录下,则只需要

(1)、在AndroidManifest.xml中配置<activity android:name=".WebGetterPreferenceActivity">

(2)、activityFrame = new Intent(this, AboutActivity.class);

startActivity(activityFrame);

如不在同一个目录,则需要:

(1)、<activity android:name=".peferences.WebGetterPreferenceActivity">

也可以:

(1)、 <activity android:name=".peferences.WebGetterPreferenceActivity">

<intent-filter>

<action android:name="com.snda.webgetter.WebGetterActivity.ACTION_PREF_EDIT" />

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

</intent-filter>

</activity>

(2)、public static final String ACTION_PREF_EDIT = "com.snda.webgetter.WebGetterActivity.ACTION_PREF_EDIT";

startActivity(new Intent(ACTION_PREF_EDIT));

6、模拟器无法上网

Android模拟器默认的地址是10.0.2.3,默认的DNS也是10.0.2.3,对于在家里上网学习Android的人(像我)来讲,一般电脑的IP都是192.168.1.100之类的,不在同一个网段。所以就会出现电脑可以上网但是模拟器不能上网的情况。其实设置方法很简单,只要把模拟器的默认DNS设置成电脑的DNS地址即可。

第一步:用系统的命令进入Android开发包的tools目录

cd X:\...\android-sdk-windows\tool

第二布:使用adb的shell,确认系统的各项属性

adb shell

getprop

getprop会列出系统当前的各项属性

第三步:得到模拟器的DNS地址

在结果里可以看到:

[net.dns1]: [10.0.2.3]

[net.dns2]: [10.0.2.4]

[net.dns3]: [10.0.2.5]

[net.dns4]: [10.0.2.6]

第四步:把dns改成我们自己的DNS

setprop net.dns1 192.168.1.1

注:一般TP-LINK及D-LINK的DNS都是192.168.1.1,如果不是请使用ipcnofig /all命令确认。

大功告成,再去使用模拟器的浏览器的话,你就可以发现你已经可以上网了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: