Android Question Rapid Debugger App crashed without any information

haungmaojung

Member
Licensed User
Longtime User

Hi B4A Friends,

I've been stuck here for several days since Rapid Debug won't help.

I'm writing an App using RDC libray to access SQL2008, SQLite library, Table class library, and network UDP to communicate with remote server. I use B4A V5.2 and a AMOBILE G0550 Android 5.5'' Mobile Barcode Scanner device. and B4A Bridge v2.12.

While I Started Debug(Rapid) and succeed to install App on my AMOBILE G0550
I started the App , it showed "Waiting for IDE Debugger to connect" for about 10 seconds then crashed without any error message and B4A Log console shows following message:

LogCat connected to: B4A-Bridge: AMOBILE G0550
--------- beginning of /dev/log/main
Installing file.
** Activity (main) Pause, UserClosed = false **
PackageAdded: package:eAI.MES.MTL.PrepareMtl
** Activity (main) Resume **


I've set many break points and add Log(msg) statements on Activity_Create and Starter Module Sub Service_Create and some other place, but since this debug version App crashed, It surly has no chance to reach those break points at all. LogCat App won't find out useful cues either.


I'm sure my B4A v5.2 is properly setup since I'm able to debug another App successfully.

Would some guys gives me some hints or point me a possible direction to find out the bugs? Thanks a lot.


Best Regards,
Victor





 

haungmaojung

Member
Licensed User
Longtime User
Hi Erel,

Thank you so much for such rapid response. I really appreciate your support.
Log detail are as followings, but I still have no idea about where is going wrong.
Do I need to upload my project zip?

Thanks again and with my Best Regards,
Victor
-----------------------------------------------------------------------------------------
LogCat connected to: B4A-Bridge: AMOBILE G0550
Installing file.
--------- beginning of /dev/log/main
** Activity (main) Resume **
from settings cache , name = install_non_market_apps , value = 1
onWindowFocus: null softInputMode=290 first=true flags=#1810100
START INPUT: com.android.internal.policy.impl.PhoneWindow$DecorView{41c08540 V.E..... R.....ID 0,0-720,1280} ic=null tba=android.view.inputmethod.EditorInfo@41c0f3d0 controlFlags=#104
Starting input: Bind result=InputBindResult{com.android.internal.view.IInputMethodSession$Stub$Proxy@41c00aa0 com.android.inputmethod.latin/.LatinIME #42}
threadid=14: exiting
threadid=14: bye!
create interp thread : stack size=32KB
create new thread
new thread created
update thread list
threadid=14: interp stack at 0x5ef37000
threadid=14: created from interp
start new thread
threadid=14: notify debugger
threadid=14 (Thread-323): calling run()
threadid=14: exiting
threadid=14: bye!
create interp thread : stack size=32KB
create new thread
new thread created
update thread list
threadid=14: interp stack at 0x5ef37000
threadid=14: created from interp
start new thread
threadid=14: notify debugger
threadid=14 (Thread-324): calling run()
Installing file.
threadid=14: exiting
threadid=14: bye!
create interp thread : stack size=32KB
create new thread
new thread created
update thread list
threadid=14: interp stack at 0x5ef37000
threadid=14: created from interp
start new thread
threadid=14: notify debugger
threadid=14 (Thread-325): calling run()
** Activity (main) Pause, UserClosed = false **
Flushing caches (mode 1)
Flushing caches (mode 0)
PackageAdded: package:eAI.MES.MTL.PrepareMtl
** Activity (main) Resume **
(AMOBILE prompts ‘Waiting for IDE Debugger to connect’ then CRASHED immediately without any information)
from settings cache , name = install_non_market_apps , value = 1
onWindowFocus: null softInputMode=290 first=true flags=#1810100
START INPUT: com.android.internal.policy.impl.PhoneWindow$DecorView{41c08540 V.E..... R.....ID 0,0-720,1280} ic=null tba=android.view.inputmethod.EditorInfo@41c80f70 controlFlags=#104
Starting input: Bind result=InputBindResult{com.android.internal.view.IInputMethodSession$Stub$Proxy@41d1c410 com.android.inputmethod.latin/.LatinIME #46}
(AMOBILE prompts toastmessage ‘Waiting for IDE Debugger to connect’ again, and IDE did not stop at breakpoint either in Activity_Create or Service_Create and other nearby breakpoints)
 
Last edited:
Upvote 0

haungmaojung

Member
Licensed User
Longtime User
Dear Erel,

There are no such errors in any other projects and this is the first time I have met.

This project use a TabHost with 4 tab pages and 4 .bal, 3 Table class (offered by Klaus and I've added some codes), RDC, SQLite, Network library, and some of my private libraries(I've compile all above classes to JAR).

TabHost, Tables.. All UI related code are located in Main module, and the others code are all put together in starter.bas. I have another successful Project use all above library except that in this App is I use 3 Table classes , while the good one use just single Table , and this App also use an array of a type, is a string array, to satisfy requirement of multi-dimension string array for manipulating 3 Tables. 3 Table classes use the same Event name and identified by a global integer as an index of current tableview

I almost give up and rewrite this App.
If you have time, may be you might take a look at attached B4A project - PrepareMtl.b4a to get me out of this poor situation.

Thank you.

Best Regards,
Victor

EDIT:
I've tried to narrow down the scope by removing all codes in Starter.bas and found the most possible bugs existed in Main.
In Main module I've proved that
1. Klaus's latest Table classes v1.43 does works well for multiple tables.
3. I've proved that use one-dimension array of array user type may solve
multi-dimensional requirement.
4. TabHost with 4 pages are well done.
 

Attachments

  • VictorProject.zip
    146 KB · Views: 147
Last edited:
Upvote 0

haungmaojung

Member
Licensed User
Longtime User
Dear Erel,

I'm still striving for breaking through this issue. In the Attached TableParts project, I've just removed all code of PrepareMtl Project 's Starter.bas and comments out some codes related to Starter in main.bas
A very strange situation happened:
1. Main without Starter module may successfully work in Rapid Debugger mode or Release mode. It'll show TabHost and select_doc layout without display data in Table view, since I've commented out RDC and SQLite functions.
2. Once an empty Starter module is added without any Application code, the same error situation occurs (Release mode crash, or Rapid Debug stop)

To compile TablePars project, please add my private library. You'll see the error.
It works without Starter module and crash immediately if Starter is added

Best Regards,
Victor
Test project: TableParts.zip
 

Attachments

  • TableParts.zip
    76.7 KB · Views: 149
  • MyLib.zip
    68.2 KB · Views: 152
Last edited:
Upvote 0

haungmaojung

Member
Licensed User
Longtime User
Hi Erel,

You won't believe that! I've just renamed Service Starter as other name, Say 'Star',
then everything goes right!
I can continue to Run Rapid Debugger to debug my app now, but I still don't know why.
May be you'll check the B4A engine about auto-launching Starter.

Best Regards,
Victor
 
Upvote 0

haungmaojung

Member
Licensed User
Longtime User
Dear Erel

I replaced Starter service module by another name, say 'eAIservice', and started this service in the Activity_Create.

I've met a problem here since Activity is started first before Service is ready.
Therefore all functional sub and global variables defined in 'eAIservice' service won't be accessible since activity is not yet completely ready and service is not yet been created.

So I add a Sub into eAIservice.bas:
Sub Activity_Create(FirstTime As Boolean)
  If FirstTime Then StartService(eAIservice)
End Sub
Sub CallBack_Activity_Resume
  CallSub(main,"CB_Activity_Resume")
En Sub
---------------------------------------------------

and put some code in main.bas:

Sub Activity_Resume
  CallSubDelayed(eAIservice,"CallBack_Activity_Resume")
  'This will block execution of Main until eAIservice becomes ready
End Sub
Sub CB_Activity_Resume
   '...All code in Activity_Resume
  gb_Service_Ready = True
  Main_Init
  Init_TabHost_Page
   ....
End Sub

It works now! Both Rapid Debugger and Release mode are working fine.

Sorry, I've to discard using Starter Service because I've been trapped here for a week, but I still hope to get the correct answer from your final update about Starter service issue.


Best Regards,
Victor
 
Last edited:
Upvote 0

haungmaojung

Member
Licensed User
Longtime User
Hi Erel,

I'm sorry to reproduce this app at this right moment due to having lost too much time.
But you can try this testA project.

If you change myService module to Starter, you'll experienced the App crashes either in Released or Debugger mode


Best Regards,
Victor
 

Attachments

  • TestA.zip
    23.9 KB · Views: 152
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
@Erel This is the error which occurs when using a starter.bas

LogCat connected to: 05157df57d72d204
--------- beginning of main
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Service (myservice) Create **
B4A Service is created
** Service (myservice) Start **
B4A Service is started
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Service (myservice) Create **
B4A Service is created
** Service (myservice) Start **
B4A Service is started
--------- beginning of system
java.lang.RuntimeException: Unable to create service b4a.example.starter: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3661)
at android.app.ActivityThread.access$2000(ActivityThread.java:198)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1759)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6837)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at b4a.example.starter.onCreate(starter.java:37)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3651)
... 9 more
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at b4a.example.starter.onCreate(starter.java:35)
... 10 more
Caused by: java.lang.RuntimeException: java.lang.NullPointerException: Attempt to read from field 'anywheresoftware.b4a.BALayout anywheresoftware.b4a.BA.vg' on a null object reference
at b4a.example.main.initializeProcessGlobals(main.java:513)
... 13 more
Caused by: java.lang.NullPointerException: Attempt to read from field 'anywheresoftware.b4a.BALayout anywheresoftware.b4a.BA.vg' on a null object reference
at anywheresoftware.b4a.keywords.Common.PerXToCurrent(Common.java:630)
at b4a.example.main._process_globals(main.java:570)
at b4a.example.main.initializeProcessGlobals(main.java:509)
... 13 more
 
Upvote 0
Top