Unfortunately, ... has stopped.

Интерфейс, диалоги, темы, стили, меню
Ответить
emel-maks-va
Сообщения: 2
Зарегистрирован: 16 апр 2014, 14:34

Unfortunately, ... has stopped.

Сообщение emel-maks-va » 16 апр 2014, 14:50

Всем привет. Изучаю только 8 урок со startandroid.ru, но уже есть проблемы. А именно, когда я сделал 1 часть урока (на видео до 3:20), запустил приложение, мне выдало ошибку

Код: Выделить всё

Unfortunately, ... has stopped.
А в log cat

Код: Выделить всё

04-16 07:31:34.276: I/ActivityManager(380): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.example.p8/.MainActivity} from pid 540
04-16 07:31:34.286: E/SoundPool(380): error loading /system/media/audio/ui/Effect_Tick.ogg
04-16 07:31:34.286: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
04-16 07:31:34.286: E/SoundPool(380): error loading /system/media/audio/ui/Effect_Tick.ogg
04-16 07:31:34.286: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
04-16 07:31:34.286: E/SoundPool(380): error loading /system/media/audio/ui/Effect_Tick.ogg
04-16 07:31:34.286: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
04-16 07:31:34.286: E/SoundPool(380): error loading /system/media/audio/ui/Effect_Tick.ogg
04-16 07:31:34.286: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
04-16 07:31:34.286: E/SoundPool(380): error loading /system/media/audio/ui/Effect_Tick.ogg
04-16 07:31:34.386: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
04-16 07:31:34.386: E/SoundPool(380): error loading /system/media/audio/ui/KeypressStandard.ogg
04-16 07:31:34.386: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/KeypressStandard.ogg
04-16 07:31:34.386: E/SoundPool(380): error loading /system/media/audio/ui/KeypressSpacebar.ogg
04-16 07:31:34.396: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/KeypressSpacebar.ogg
04-16 07:31:34.396: E/SoundPool(380): error loading /system/media/audio/ui/KeypressDelete.ogg
04-16 07:31:34.396: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/KeypressDelete.ogg
04-16 07:31:34.396: E/SoundPool(380): error loading /system/media/audio/ui/KeypressReturn.ogg
04-16 07:31:34.396: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/KeypressReturn.ogg
04-16 07:31:34.396: E/SoundPool(380): error loading /system/media/audio/ui/KeypressInvalid.ogg
04-16 07:31:34.396: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/KeypressInvalid.ogg
04-16 07:31:34.396: W/AudioService(380): onLoadSoundEffects(), Error -1 while loading samples
04-16 07:31:34.416: D/gralloc(49): Registering a buffer in the process that created it. This may cause memory ordering problems.
04-16 07:31:34.416: E/libEGL(49): called unimplemented OpenGL ES API
04-16 07:31:34.426: E/libEGL(49): called unimplemented OpenGL ES API
04-16 07:31:34.426: E/libEGL(49): called unimplemented OpenGL ES API
04-16 07:31:34.426: E/libEGL(49): called unimplemented OpenGL ES API
04-16 07:31:34.426: E/SurfaceFlinger(49): glCheckFramebufferStatusOES error -2032605036
04-16 07:31:34.426: E/SurfaceFlinger(49): got GL_FRAMEBUFFER_COMPLETE_OES error while taking screenshot
04-16 07:31:34.426: E/libEGL(49): called unimplemented OpenGL ES API
04-16 07:31:34.426: E/libEGL(49): called unimplemented OpenGL ES API
04-16 07:31:34.426: W/WindowManager(380): Screenshot failure taking screenshot for (164x246) to layer 21005
04-16 07:31:34.516: I/Choreographer(380): Skipped 110 frames!  The application may be doing too much work on its main thread.
04-16 07:31:34.546: I/Choreographer(540): Skipped 177 frames!  The application may be doing too much work on its main thread.
04-16 07:31:34.776: I/Choreographer(380): Skipped 39 frames!  The application may be doing too much work on its main thread.
04-16 07:31:34.796: I/ActivityManager(380): Start proc com.example.p8 for activity com.example.p8/.MainActivity: pid=1209 uid=10055 gids={50055}
04-16 07:31:34.806: D/dalvikvm(1209): Not late-enabling CheckJNI (already on)
04-16 07:31:35.186: I/Choreographer(380): Skipped 33 frames!  The application may be doing too much work on its main thread.
04-16 07:31:35.446: I/Choreographer(380): Skipped 53 frames!  The application may be doing too much work on its main thread.
04-16 07:31:35.526: I/Choreographer(380): Skipped 42 frames!  The application may be doing too much work on its main thread.
04-16 07:31:35.586: I/Choreographer(380): Skipped 36 frames!  The application may be doing too much work on its main thread.
04-16 07:31:35.846: D/AndroidRuntime(1209): Shutting down VM
04-16 07:31:35.846: W/dalvikvm(1209): threadid=1: thread exiting with uncaught exception (group=0xb3a90ba8)
04-16 07:31:35.866: E/AndroidRuntime(1209): FATAL EXCEPTION: main
04-16 07:31:35.866: E/AndroidRuntime(1209): Process: com.example.p8, PID: 1209
04-16 07:31:35.866: E/AndroidRuntime(1209): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.p8/com.example.p8.MainActivity}: java.lang.NullPointerException
04-16 07:31:35.866: E/AndroidRuntime(1209): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
04-16 07:31:35.866: E/AndroidRuntime(1209): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
04-16 07:31:35.866: E/AndroidRuntime(1209): 	at android.app.ActivityThread.access$800(ActivityThread.java:135)
04-16 07:31:35.866: E/AndroidRuntime(1209): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
04-16 07:31:35.866: E/AndroidRuntime(1209): 	at android.os.Handler.dispatchMessage(Handler.java:102)
04-16 07:31:35.866: E/AndroidRuntime(1209): 	at android.os.Looper.loop(Looper.java:136)
04-16 07:31:35.866: E/AndroidRuntime(1209): 	at android.app.ActivityThread.main(ActivityThread.java:5017)
04-16 07:31:35.866: E/AndroidRuntime(1209): 	at java.lang.reflect.Method.invokeNative(Native Method)
04-16 07:31:35.866: E/AndroidRuntime(1209): 	at java.lang.reflect.Method.invoke(Method.java:515)
04-16 07:31:35.866: E/AndroidRuntime(1209): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
04-16 07:31:35.866: E/AndroidRuntime(1209): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
04-16 07:31:35.866: E/AndroidRuntime(1209): 	at dalvik.system.NativeStart.main(Native Method)
04-16 07:31:35.866: E/AndroidRuntime(1209): Caused by: java.lang.NullPointerException
04-16 07:31:35.866: E/AndroidRuntime(1209): 	at com.example.p8.MainActivity.onCreate(MainActivity.java:20)
04-16 07:31:35.866: E/AndroidRuntime(1209): 	at android.app.Activity.performCreate(Activity.java:5231)
04-16 07:31:35.866: E/AndroidRuntime(1209): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
04-16 07:31:35.866: E/AndroidRuntime(1209): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
04-16 07:31:35.866: E/AndroidRuntime(1209): 	... 11 more
04-16 07:31:35.876: W/ActivityManager(380):   Force finishing activity com.example.p8/.MainActivity
04-16 07:31:36.206: I/WindowManager(380): Screenshot max retries 4 of Token{b4031f68 ActivityRecord{b3f949f0 u0 com.example.p8/.MainActivity t9 f}} appWin=Window{b3f9e270 u0 Starting com.example.p8} drawState=4
04-16 07:31:36.206: W/WindowManager(380): Screenshot failure taking screenshot for (320x480) to layer 21010
04-16 07:31:36.386: I/Choreographer(380): Skipped 53 frames!  The application may be doing too much work on its main thread.
04-16 07:31:36.716: W/ActivityManager(380): Activity pause timeout for ActivityRecord{b3f949f0 u0 com.example.p8/.MainActivity t9 f}
04-16 07:31:37.006: I/Choreographer(540): Skipped 43 frames!  The application may be doing too much work on its main thread.
04-16 07:31:37.466: I/Choreographer(380): Skipped 68 frames!  The application may be doing too much work on its main thread.
04-16 07:31:37.616: I/Choreographer(380): Skipped 72 frames!  The application may be doing too much work on its main thread.
04-16 07:31:37.756: I/Choreographer(380): Skipped 38 frames!  The application may be doing too much work on its main thread.
04-16 07:31:37.816: I/Choreographer(380): Skipped 39 frames!  The application may be doing too much work on its main thread.
04-16 07:31:37.886: I/Choreographer(380): Skipped 39 frames!  The application may be doing too much work on its main thread.
04-16 07:31:38.336: E/SoundPool(380): error loading /system/media/audio/ui/Effect_Tick.ogg
04-16 07:31:38.336: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
04-16 07:31:38.336: E/SoundPool(380): error loading /system/media/audio/ui/Effect_Tick.ogg
04-16 07:31:38.336: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
04-16 07:31:38.346: E/SoundPool(380): error loading /system/media/audio/ui/Effect_Tick.ogg
04-16 07:31:38.346: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
04-16 07:31:38.346: E/SoundPool(380): error loading /system/media/audio/ui/Effect_Tick.ogg
04-16 07:31:38.346: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
04-16 07:31:38.346: E/SoundPool(380): error loading /system/media/audio/ui/Effect_Tick.ogg
04-16 07:31:38.346: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
04-16 07:31:38.346: E/SoundPool(380): error loading /system/media/audio/ui/KeypressStandard.ogg
04-16 07:31:38.346: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/KeypressStandard.ogg
04-16 07:31:38.346: E/SoundPool(380): error loading /system/media/audio/ui/KeypressSpacebar.ogg
04-16 07:31:38.346: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/KeypressSpacebar.ogg
04-16 07:31:38.346: E/SoundPool(380): error loading /system/media/audio/ui/KeypressDelete.ogg
04-16 07:31:38.346: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/KeypressDelete.ogg
04-16 07:31:38.346: E/SoundPool(380): error loading /system/media/audio/ui/KeypressReturn.ogg
04-16 07:31:38.346: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/KeypressReturn.ogg
04-16 07:31:38.346: E/SoundPool(380): error loading /system/media/audio/ui/KeypressInvalid.ogg
04-16 07:31:38.346: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/KeypressInvalid.ogg
04-16 07:31:38.396: W/AudioService(380): onLoadSoundEffects(), Error -1 while loading samples
04-16 07:31:38.476: I/Choreographer(380): Skipped 69 frames!  The application may be doing too much work on its main thread.
04-16 07:31:38.486: I/Process(1209): Sending signal. PID: 1209 SIG: 9
04-16 07:31:38.536: I/Choreographer(380): Skipped 50 frames!  The application may be doing too much work on its main thread.
04-16 07:31:38.536: W/InputMethodManagerService(380): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@b415f350 attribute=null, token = android.os.BinderProxy@b40671a8
04-16 07:31:38.546: I/ActivityManager(380): Process com.example.p8 (pid 1209) has died.
04-16 07:31:38.666: I/Choreographer(380): Skipped 30 frames!  The application may be doing too much work on its main thread.

Аватара пользователя
Foenix
Сообщения: 4200
Зарегистрирован: 20 окт 2012, 12:01

Re: Unfortunately, ... has stopped.

Сообщение Foenix » 16 апр 2014, 15:12

у тебя NPE. Ищи слова Caused by там будет ошибка, дальше ищи адрес в своей программе - щелкай два раза, перенесешься к ошибке и смотри что там не так. При NPE - обычно значит, что не инициализирована и равна null какая-то переменная в данной строке. Соответственно ищи по коду выше где эта переменная получает значение. Либо в той строке что-то пошло не так, либо такой строки нет - опущена, не в том цикле или что-то типа того.
Изучайте лог! это не сложно!
Последний раз редактировалось Foenix 08 май 2014, 17:55, всего редактировалось 2 раза.
R.id.team

NullPointerException - что делать???
viewtopic.php?f=33&t=3899&p=28952#p28952
Где моя ошибка?
viewtopic.php?f=60&t=3198

emel-maks-va
Сообщения: 2
Зарегистрирован: 16 апр 2014, 14:34

Re: Unfortunately, ... has stopped.

Сообщение emel-maks-va » 16 апр 2014, 20:31

Как оказалось очаг проблем оказался совсем далеко. Проблема заключалась в использовании fragment_main, а не activity_main
Foenix, все равно спасибо за ответ

RaMoNVicious
Сообщения: 6
Зарегистрирован: 12 июн 2014, 22:28

Re: Unfortunately, ... has stopped.

Сообщение RaMoNVicious » 18 июн 2014, 01:13

emel-maks-va писал(а):Как оказалось очаг проблем оказался совсем далеко. Проблема заключалась в использовании fragment_main, а не activity_main
Foenix, все равно спасибо за ответ
и как решить проблему?.. ну если присутствует этот фрагмент...

Аватара пользователя
klblk
Сообщения: 1097
Зарегистрирован: 18 окт 2012, 11:17
Откуда: г. Красноярск

Re: Unfortunately, ... has stopped.

Сообщение klblk » 18 июн 2014, 05:47

Выучить фрагменты, но для начала можно поискать по форуму "fragment_main".

Ответить