App closes unexpectedly: FATAL EXCEPTION: main

viljemto

Member
Licensed User
Longtime User
Hi,

I would like to ask if somebody maybe had same experience with fatal exception bellow. Any help would be appreciated.

It does not come up every I run my app, just once in a while.

From service I call
B4X:
CallSub(Main, "Pripravi_besedilo_za_prikaz")
, which updates values in labels on main. In some cases I have to call it two time because of some restrictions. I think that maybe here somewhere is the problem.

What do you think?

B4X:
01-19 10:52:37.690 D/OpenGLRenderer(18617): Flushing caches (mode 1)
01-19 10:52:37.690 I/B4A     (18617): Killing previous instance (main).
01-19 10:52:37.690 D/UploadService(30323): UpdateThread is looping keepService = false
01-19 10:52:37.700 W/ActivityManager(1601): Duplicate finish request for ActivityRecord{41a177a0 app.tel.main/.main}
01-19 10:52:37.750 I/HtcMessageUploader(30336): <UploadMessageReceiver> Start thread to upload fota event message:Intent { act=android.net.conn.CONNECTIVITY_CHANGE flg=0x10000010 cmp=com.htc.htcMessageUploader/.UploadMessageReceiver (has extras) }
01-19 10:52:37.760 I/B4A     (18617): ** Activity (main) Pause, UserClosed = true **
01-19 10:52:37.760 I/B4A     (18617): app.tel.main - Main - Activity_Pause
01-19 10:52:37.780 I/HtcMessageUploader(30336): <UploadMessageService> onCreate()
01-19 10:52:37.790 D/AndroidRuntime(18617): Shutting down VM
01-19 10:52:37.790 W/dalvikvm(18617): threadid=1: thread exiting with uncaught exception (group=0x40ab5228)
01-19 10:52:37.790 D/Socket_Alarm(30336): registerHTCSocketMonitorCallBack
01-19 10:52:37.800 I/B4A     (18617): main$WaitForLayoutrun (java line: 65)
01-19 10:52:37.800 D/Socket_Alarm(30336): set mSocketMonitor
01-19 10:52:37.800 D/Socket_Alarm(30336): HTCSocketMonitorImpl::HTCSocketMonitorImpl
01-19 10:52:37.810 I/B4A     (18617): java.lang.NullPointerException
01-19 10:52:37.810 I/B4A     (18617):    at app.tel.main.main$WaitForLayout.run(main.java:65)
01-19 10:52:37.810 I/B4A     (18617):    at android.os.Handler.handleCallback(Handler.java:608)
01-19 10:52:37.810 I/B4A     (18617):    at android.os.Handler.dispatchMessage(Handler.java:92)
01-19 10:52:37.810 I/B4A     (18617):    at android.os.Looper.loop(Looper.java:156)
01-19 10:52:37.810 I/B4A     (18617):    at android.app.ActivityThread.main(ActivityThread.java:4977)
01-19 10:52:37.810 I/B4A     (18617):    at java.lang.reflect.Method.invokeNative(Native Method)
01-19 10:52:37.810 I/B4A     (18617):    at java.lang.reflect.Method.invoke(Method.java:511)
01-19 10:52:37.810 I/B4A     (18617):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
01-19 10:52:37.810 I/B4A     (18617):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
01-19 10:52:37.810 I/B4A     (18617):    at dalvik.system.NativeStart.main(Native Method)
01-19 10:52:37.820 I/ActivityManager(1601): Start proc com.google.android.apps.uploader for broadcast com.google.android.apps.uploader/.ConnectivityBroadcastReceiver: pid=30352 uid=10097 gids={3003}
01-19 10:52:37.830 E/EmbeddedLogger(1601): App crashed! Process: app.tel.main
01-19 10:52:37.830 E/EmbeddedLogger(1601): App crashed! Package: app.tel.main v1 (16.0)
01-19 10:52:37.830 E/EmbeddedLogger(1601): App crashed! Application Label: APP Tel
01-19 10:52:37.830 E/AndroidRuntime(18617): FATAL EXCEPTION: main
01-19 10:52:37.830 E/AndroidRuntime(18617): java.lang.NullPointerException
01-19 10:52:37.830 E/AndroidRuntime(18617):    at app.tel.main.main$WaitForLayout.run(main.java:65)
01-19 10:52:37.830 E/AndroidRuntime(18617):    at android.os.Handler.handleCallback(Handler.java:608)
01-19 10:52:37.830 E/AndroidRuntime(18617):    at android.os.Handler.dispatchMessage(Handler.java:92)
01-19 10:52:37.830 E/AndroidRuntime(18617):    at android.os.Looper.loop(Looper.java:156)
01-19 10:52:37.830 E/AndroidRuntime(18617):    at android.app.ActivityThread.main(ActivityThread.java:4977)
01-19 10:52:37.830 E/AndroidRuntime(18617):    at java.lang.reflect.Method.invokeNative(Native Method)
01-19 10:52:37.830 E/AndroidRuntime(18617):    at java.lang.reflect.Method.invoke(Method.java:511)
01-19 10:52:37.830 E/AndroidRuntime(18617):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
01-19 10:52:37.830 E/AndroidRuntime(18617):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
01-19 10:52:37.830 E/AndroidRuntime(18617):    at dalvik.system.NativeStart.main(Native Method)
01-19 10:52:37.830 W/ActivityManager(1601):   Force finishing activity app.tel.main/.main
 
Last edited:

viljemto

Member
Licensed User
Longtime User
I have tried with CallSubDelayed. Thank you. Good suggestion, but its the same.

I have noticed, that if I open my app, sometines it loads really long and them sometimes comes to timeout. Probably this happens in Main on Activity_Create or Activity_Resume when it loads Layout.

Maybe something with this section.
B4X:
' load the Main layout file
Activity.LoadLayout("Main")      
' load the ScrollView.Panel layout file
ScrollView1.Panel.LoadLayout("Postavitev")
' set the ScrollView.Panel.Height to the pnlSetup Panel height
ScrollView1.Panel.height = Panel1.height
 
Last edited:
Upvote 0

viljemto

Member
Licensed User
Longtime User
Mr. Erel - thank you for creating this great app B4A, for all your help, suggestions and anything that I have maybe forgot.

p.s.: Now it works. Pause/wait sub was making problems, like you have said.
 
Upvote 0
Top