开发者

uh oh - app stopped unexpectedly

开发者 https://www.devze.com 2023-01-28 10:08 出处:网络
I ran my app in the emulator. Wh开发者_运维知识库ere do I even begin? First line from LogCat: 11-28 23:41:03.912: ERROR/AndroidRuntime(391): FATAL EXCEPTION: mainIf you are using eclipse then open

uh oh - app stopped unexpectedly

I ran my app in the emulator. Wh开发者_运维知识库ere do I even begin?

First line from LogCat:

11-28 23:41:03.912: ERROR/AndroidRuntime(391): FATAL EXCEPTION: main


If you are using eclipse then open the debug view. One of the windows is logcat. Watch that window and when the app crashes there will be a stream of red text (or click the circled e in the filters above the window). The first line will be the actual reason for the crash, more useful will be a line about halfway down that starts with 'caused by ..'.

Figure out what caused it and then do some research to find a solution. Sometimes it is as easy as 'caused by activity not in manifest file. Did you add activity to the manifest?' and then other times it takes some digging.

You can also copy and paste the logcat code from that window and add to your question for more help.


Since this is happening before your app launches, you should make sure your AndroidManifest.xml is setup correctly. Make sure your activity is declared, and the android:name attribute either contains the entire package, or your start your classname with a . For example, it might be:

<activity android:name=".MyActivity"...

(where MyActivity is the name of the Activity class being launched) or

 <activity android:name="com.levinotik.nycourts.MyActivity"...
0

精彩评论

暂无评论...
验证码 换一张
取 消