App closes unexpectedly. Log shows "FATAL EXCEPTION: main"

Mickster

Active Member
Licensed User
Longtime User
Hey guys,

Yesterday I had a perfectly working application. I decided for the sake of cleaning it up that I wanted to move chunks of the code around and split it between new modules.

When I compile, the app is installed but instantly closes with an android error. I've tried using breakpoints to find the offending code, but it appears as though none of the code is even executed. The unfiltered log shows this:

B4X:
FATAL EXCEPTION: main
java.lang.RuntimeException: java.lang.NullPointerException
   at phenix.phenixasdasdasdas.main.initializeProcessGlobals(main.java:2411)
   at phenix.phenixasdasdasdas.main.afterFirstLayout(main.java:80)
   at phenix.phenixasdasdasdas.main.access$100(main.java:16)
   at phenix.phenixasdasdasdas.main$WaitForLayout.run(main.java:72)
   at android.os.Handler.handleCallback(Handler.java:587)
   at android.os.Handler.dispatchMessage(Handler.java:92)
   at android.os.Looper.loop(Looper.java:132)

The log continues in a similar manner for a few more lines. Does anyone know what might be wrong?
Thanks
 

stevel05

Expert
Licensed User
Longtime User
Just a guess, unless you can post some code it'll be hard to find straight away without asking questions, but do you still have a Process_Globals sub in the Main module? (Or all code modules)
 
Upvote 0

Mickster

Active Member
Licensed User
Longtime User
Thanks for the quick responses.

I just ran another check to make sure I had all the correct sub routines. They're all there. Looking through my Process_Globals I haven't noticed anything out of the ordinary. The program is too big to upload, but I can paste the code into pastebin.

Main Module - Pastebin.com

That is the code in my 'main' module.

Thanks
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
You are doing a lot of processing within the Global subs, I'm not sure whether loading files and complex assigns are reasonable in there. I certainly tend not to do overly complex things in there, just simple assignments when required.
 
Upvote 0

Mickster

Active Member
Licensed User
Longtime User
Thanks, note taken. This is very much a collaboration project and a lot of the code is sloppy and unorganised. I plan on making everything tidier once it's finished.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
I'm not saying that you definitely shouldn't it just feels that way to me, perhaps Erel would comment as to what should and more importantly should not be included in the Process_Global and Global Subs.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…