项目可以在一台计算机上运行,但不能在另一台计算机上运行?
我的朋友有一个 XML 解析示例,我尝试遵循该示例,但没有成功。因此,他只是将项目文件夹放在他的闪存驱动器上,然后我将其导入到 Eclipse 中。但奇怪的是,该应用程序仍然强行关闭。关于为什么会发生这种情况有什么想法吗?这是同一个项目!如果您想要我们正在使用的代码,可以在此处找到,问题中。
先感谢您。
编辑:来自 LogCat 的崩溃日志:
08-22 10:37:35.279: ERROR/AndroidRuntime(482): FATAL EXCEPTION: main
08-22 10:37:35.279: ERROR/AndroidRuntime(482): java.lang.RuntimeException: Unable to start activity ComponentInfo{android.example.testone.parsing/android.example.testone.parsing.LocalParsingAttemptNUMBERoneActivity}: java.lang.NullPointerException
08-22 10:37:35.279: ERROR/AndroidRuntime(482): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
08-22 10:37:35.279: ERROR/AndroidRuntime(482): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
08-22 10:37:35.279: ERROR/AndroidRuntime(482): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
08-22 10:37:35.279: ERROR/AndroidRuntime(482): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
08-22 10:37:35.279: ERROR/AndroidRuntime(482): at android.os.Handler.dispatchMessage(Handler.java:99)
08-22 10:37:35.279: ERROR/AndroidRuntime(482): at android.os.Looper.loop(Looper.java:123)
08-22 10:37:35.279: ERROR/AndroidRuntime(482): at android.app.ActivityThread.main(ActivityThread.java:4627)
08-22 10:37:35.279: ERROR/AndroidRuntime(482): at java.lang.reflect.Method.invokeNative(Native Method)
08-22 10:37:35.279: ERROR/AndroidRuntime(482): at java.lang.reflect.Method.invoke(Method.java:521)
08-22 10:37:35.279: ERROR/AndroidRuntime(482): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
08-22 10:37:35.279: ERROR/AndroidRuntime(482): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
08-22 10:37:35.279: ERROR/AndroidRuntime(482): at dalvik.system.NativeStart.main(Native Method)
08-22 10:37:35.279: ERROR/AndroidRuntime(482): Caused by: java.lang.NullPointerException
08-22 10:37:35.279: ERROR/AndroidRuntime(482): at android.example.testone.parsing.LocalParsingAttemptNUMBERoneActivity.onCreate(LocalParsingAttemptNUMBERoneActivity.java:59)
08-22 10:37:35.279: ERROR/AndroidRuntime(482): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-22 10:37:35.279: ERROR/AndroidRuntime(482): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
08-22 10:37:35.279: ERROR/AndroidRuntime(482): ... 11 more
My friend has an XML parsing example that I tried following, but it didn't work. So, he simply put the project folder on his flashdrive, and I then imported it into Eclipse. Strangely though, the app is still force closing. Any ideas on why this could be occuring? It's the same project! If you want the code we're working with, it can be found here, in the question.
Thank you in advance.
EDIT: Crash log from LogCat:
08-22 10:37:35.279: ERROR/AndroidRuntime(482): FATAL EXCEPTION: main
08-22 10:37:35.279: ERROR/AndroidRuntime(482): java.lang.RuntimeException: Unable to start activity ComponentInfo{android.example.testone.parsing/android.example.testone.parsing.LocalParsingAttemptNUMBERoneActivity}: java.lang.NullPointerException
08-22 10:37:35.279: ERROR/AndroidRuntime(482): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
08-22 10:37:35.279: ERROR/AndroidRuntime(482): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
08-22 10:37:35.279: ERROR/AndroidRuntime(482): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
08-22 10:37:35.279: ERROR/AndroidRuntime(482): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
08-22 10:37:35.279: ERROR/AndroidRuntime(482): at android.os.Handler.dispatchMessage(Handler.java:99)
08-22 10:37:35.279: ERROR/AndroidRuntime(482): at android.os.Looper.loop(Looper.java:123)
08-22 10:37:35.279: ERROR/AndroidRuntime(482): at android.app.ActivityThread.main(ActivityThread.java:4627)
08-22 10:37:35.279: ERROR/AndroidRuntime(482): at java.lang.reflect.Method.invokeNative(Native Method)
08-22 10:37:35.279: ERROR/AndroidRuntime(482): at java.lang.reflect.Method.invoke(Method.java:521)
08-22 10:37:35.279: ERROR/AndroidRuntime(482): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
08-22 10:37:35.279: ERROR/AndroidRuntime(482): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
08-22 10:37:35.279: ERROR/AndroidRuntime(482): at dalvik.system.NativeStart.main(Native Method)
08-22 10:37:35.279: ERROR/AndroidRuntime(482): Caused by: java.lang.NullPointerException
08-22 10:37:35.279: ERROR/AndroidRuntime(482): at android.example.testone.parsing.LocalParsingAttemptNUMBERoneActivity.onCreate(LocalParsingAttemptNUMBERoneActivity.java:59)
08-22 10:37:35.279: ERROR/AndroidRuntime(482): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-22 10:37:35.279: ERROR/AndroidRuntime(482): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
08-22 10:37:35.279: ERROR/AndroidRuntime(482): ... 11 more
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于某种原因,该程序在发布问题日期的第二天开始运行。我的猜测是互联网连接发生了一些事情。
For one reason or another, the program is working the day after than the posted question's date. My guess is something that went on with the internet connectivity.