成功测试后,我试图将我的项目/包从'test ...'重命名为更相关的东西。我尽可能使用各种Eclipse重构助手。所有源文件现在看起来都在顶部有正确的包,清单似乎有正确的包名等。我执行了'干净'。
一切似乎都很好。唯一的问题是它不会启动 - 甚至没有进入活动onCreate()处理程序。它在AvtivityThread.performLaunchActivity(ActivityThread $ ActivityRecord,Intent)第2417行崩溃。
显然,其中仍有旧名称,但我找不到它。
任何建议在哪里查看/做什么?
按要求:log cat(控制台中没有任何内容):
07-14 07:00:04.149: D/AndroidRuntime(347): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<<br>
07-14 07:00:04.149: D/AndroidRuntime(347): CheckJNI is ON<br>
07-14 07:00:04.389: D/AndroidRuntime(347): --- registering native functions ---<br>
07-14 07:00:04.830: D/ddm-heap(347): Got feature list request<br>
07-14 07:00:05.239: D/AndroidRuntime(347): Shutting down VM<br>
07-14 07:00:05.250: D/dalvikvm(347): DestroyJavaVM waiting for non-daemon threads to exit<br>
07-14 07:00:05.250: D/dalvikvm(347): DestroyJavaVM shutting VM down<br>
07-14 07:00:05.250: D/dalvikvm(347): HeapWorker thread shutting down<br>
07-14 07:00:05.259: D/dalvikvm(347): HeapWorker thread has shut down<br>
07-14 07:00:05.259: D/jdwp(347): JDWP shutting down net...<br>
07-14 07:00:05.269: I/dalvikvm(347): Debugger has detached; object registry had 1 entries<br>
07-14 07:00:05.279: D/dalvikvm(347): VM cleaning up<br>
07-14 07:00:05.291: E/AndroidRuntime(347): ERROR: thread attach failed<br>
07-14 07:00:05.309: D/dalvikvm(347): LinearAlloc 0x0 used 629532 of 5242880 (12%)<br>
07-14 07:00:05.801: D/AndroidRuntime(355): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<<br>
07-14 07:00:05.809: D/AndroidRuntime(355): CheckJNI is ON<br>
07-14 07:00:06.049: D/AndroidRuntime(355): --- registering native functions ---<br>
07-14 07:00:06.490: D/ddm-heap(355): Got feature list request<br>
07-14 07:00:06.910: D/ActivityManager(52): Uninstalling process uk.co.nightshadearts.golfcaddy<br>
07-14 07:00:06.910: I/ActivityManager(52): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=uk.co.nightshadearts.golfcaddy/uk.co.nightshadearts.golfcaddy }<br>
07-14 07:00:06.969: D/AndroidRuntime(355): Shutting down VM<br>
07-14 07:00:06.969: D/dalvikvm(355): DestroyJavaVM waiting for non-daemon threads to exit<br>
07-14 07:00:07.009: E/AndroidRuntime(355): ERROR: thread attach failed<br>
07-14 07:00:07.009: D/dalvikvm(355): DestroyJavaVM shutting VM down<br>
07-14 07:00:07.009: D/dalvikvm(355): HeapWorker thread shutting down<br>
07-14 07:00:07.019: D/dalvikvm(355): HeapWorker thread has shut down<br>
07-14 07:00:07.019: D/jdwp(355): JDWP shutting down net...<br>
07-14 07:00:07.019: I/dalvikvm(355): Debugger has detached; object registry had 1 entries<br>
07-14 07:00:07.051: D/dalvikvm(355): VM cleaning up<br>
07-14 07:00:07.070: D/dalvikvm(355): LinearAlloc 0x0 used 639500 of 5242880 (12%)<br>
07-14 07:00:07.160: I/ActivityManager(52): Start proc uk.co.nightshadearts.golfcaddy for activity uk.co.nightshadearts.golfcaddy/uk.co.nightshadearts.golfcaddy: pid=362 uid=10031 gids={1015}<br>
07-14 07:00:07.309: D/ddm-heap(362): Got feature list request<br>
07-14 07:00:07.460: W/ActivityThread(362): Application uk.co.nightshadearts.golfcaddy is waiting for the debugger on port 8100...<br>
07-14 07:00:07.489: I/System.out(362): Sending WAIT chunk<br>
07-14 07:00:07.510: I/dalvikvm(362): Debugger is active<br>
07-14 07:00:07.750: I/System.out(362): Debugger has connected<br>
07-14 07:00:07.750: I/System.out(362): waiting for debugger to settle...<br>
07-14 07:00:07.951: I/System.out(362): waiting for debugger to settle...<br>
07-14 07:00:08.150: I/System.out(362): waiting for debugger to settle...<br>
07-14 07:00:08.350: I/System.out(362): waiting for debugger to settle...<br>
07-14 07:00:08.559: I/System.out(362): waiting for debugger to settle...<br>
07-14 07:00:08.759: I/System.out(362): waiting for debugger to settle...<br>
07-14 07:00:08.960: I/System.out(362): waiting for debugger to settle...<br>
07-14 07:00:09.187: I/System.out(362): waiting for debugger to settle...<br>
07-14 07:00:09.397: I/System.out(362): waiting for debugger to settle...<br>
07-14 07:00:09.609: I/System.out(362): waiting for debugger to settle...<br>
07-14 07:00:09.827: I/System.out(362): waiting for debugger to settle...<br>
07-14 07:00:10.039: I/System.out(362): waiting for debugger to settle...<br>
07-14 07:00:10.263: I/System.out(362): waiting for debugger to settle...<br>
07-14 07:00:10.479: I/System.out(362): debugger has settled (1449)<br>
07-14 07:00:10.681: E/gralloc(52): [unregister] handle 0x3fa718 still locked (state=40000001)<br>
07-14 07:00:17.029: W/ActivityManager(52): Launch timeout has expired, giving up wake lock!<br>
07-14 07:00:17.391: W/ActivityManager(52): Activity idle timeout for HistoryRecord{44f00a48 uk.co.nightshadearts.golfcaddy/uk.co.nightshadearts.golfcaddy}<br>
呼叫:
GolfCaddy [Android Application]
DalvikVM[localhost:8610]
Thread [<3> main] (Suspended (exception RuntimeException))
ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2417
ActivityThread.handleLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2512
ActivityThread.access$2200(ActivityThread, ActivityThread$ActivityRecord, Intent) line: 119
ActivityThread$H.handleMessage(Message) line: 1863
ActivityThread$H(Handler).dispatchMessage(Message) line: 99
Looper.loop() line: 123
ActivityThread.main(String[]) line: 4363
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]
Method.invoke(Object, Object...) line: 521
ZygoteInit$MethodAndArgsCaller.run() line: 860
ZygoteInit.main(String[]) line: 618
NativeStart.main(String[]) line: not available [native method]
Thread [<13> Binder Thread #2] (Running)
Thread [<11> Binder Thread #1] (Running)
答案:
实际上,我似乎已经解决了它,虽然我真的不知道我修复了什么。
按照来自alextsc app won't install after package rename的指示,我做了以下事情:
完全抛弃了错误的项目(删除了项目和文件树) - 幸运的是,在我做任何事情之前,我已经有了复制原文的常识。
将原件复制回“工作台”下。
使用现有来源选项创建新项目(原始名称)。
让它恢复正常。
然后rt clk on project并选择Android Tools&gt;&gt;重命名应用程序包,让它做它想做的一切。
在src下,程序包仍然具有旧名称。使用Eclipse重构来更改为新名称。
似乎仍有效。所有src文件也都有正确的包。
重命名(一)活动 - 仍然有效。之后,只有更多的内部代码修改符合XML应用程序名称。
结论:Android工具&gt;&gt;重命名应用程序包做了些什么,但我不知道是什么。
道德:选择一个名字并坚持将来。
答案 0 :(得分:1)
将清单中的包名称更改为
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.org.xxx" // your packagename here..
>
</manifest>
更改之后,R.java将再次在新包下创建,然后你必须在所有活动中导入R. ..
试试这个,它可能对你有帮助..
答案 1 :(得分:0)
这就是我所做的。
在Eclipse项目“src”文件夹中,您将拥有一个名为“com.test ...”的东西,将其重命名为新名称,然后单击“确定”。然后所有文件都应自动更新。至少它对我来说很完美。
请记住,你也必须在Android Manifest中更改它。