android - Cordova app compiles but crashes on run. How to get error report? -


i have cordova app compiles no errors. however, when lunch app android device instantly crashes on startup. having hard time debug when not know bug is…

question: there way error report crash?

i use chrome debug app works if app able load , run on device.

you requested article logcat... i'm putting in answer section since information comments :)

docs

in case of android, can go developer's page.

here android's page logcat

if use android studio, can check link.

capturing

basically, can capture logcat following command:

adb logcat 

there's lot of parameters can add command helps filter , display message want... personal... use command below message timestamp:

adb logcat -v time 

you can redirect output file , analyze in text editor.

analyzing

if app crashing, you'll like:

07-09 08:29:13.474 21144-21144/com.example.khan.abc d/androidruntime: shutting down vm 07-09 08:29:13.475 21144-21144/com.example.khan.abc e/androidruntime: fatal exception: main     process: com.example.khan.abc, pid: 21144     java.lang.nullpointerexception: attempt invoke virtual method 'void android.support.v4.app.fragmentactivity.onbackpressed()' on null object reference      @ com.example.khan.abc.audiofragment$1.onclick(audiofragment.java:125)      @ android.view.view.performclick(view.java:4848)      @ android.view.view$performclick.run(view.java:20262)      @ android.os.handler.handlecallback(handler.java:815)      @ android.os.handler.dispatchmessage(handler.java:104)      @ android.os.looper.loop(looper.java:194)      @ android.app.activitythread.main(activitythread.java:5631)      @ java.lang.reflect.method.invoke(native method)      @ java.lang.reflect.method.invoke(method.java:372)      @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:959)      @ com.android.internal.os.zygoteinit.main(zygoteinit.java:754) 07-09 08:29:15.195 21144-21144/com.example.khan.abc i/process: sending signal. pid: 21144 sig: 9 

this part of log shows lot of information:

  • when issue happened: 07-09 08:29:13.475

it important check when issue happened... may find several errors in log... must sure checking proper messages :)

  • which app crashed: com.example.khan.abc

this way, know app crashed (to sure checking logs message)

  • which error: java.lang.nullpointerexception

a null pointer exception error

  • detailed info error: attempt invoke virtual method 'void android.support.v4.app.fragmentactivity.onbackpressed()' on null object reference

you tried call method onbackpressed() fragmentactivity object. however, object null when did it.

  • stack trace: stack trace shows method invocation order... sometimes, error happens in calling method (and not in called method).

    at com.example.khan.abc.audiofragment$1.onclick(audiofragment.java:125)

error happened in file com.example.khan.abc.audiofragment.java, inside onclick() method @ line: 125 (stacktrace shows line error happened)

it called by:

at android.view.view.performclick(view.java:4848) 

which called by:

at android.view.view$performclick.run(view.java:20262) 

which called by:

at android.os.handler.handlecallback(handler.java:815) 

etc....

overview

this overview... not logs simple etc... share idea , provide entry-level information you...

i hope someway... regards


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -