Android Question java.lang.NullPointerException: null receiver in Starter module for a database SLQite

DALB

Active Member
Licensed User
Hi, everyone,

Starting a new project, introducing a database function in the Starter module, it's the first time I have the problem below.

At this lines

B4X:
Sub Service_Start (StartingIntent As Intent)
    Service.StopAutomaticForeground 'Starter service can start in the foreground state in some edge cases.
If False Then
Log("ici")
End If
End sub

with this log

** Service (starter) Start **
Error occurred on line: 43 (Starter) <-- this is line 43 of my module but the 6 of the extraction
java.lang.NullPointerException: null receiver
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:777)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:354)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at b4a.example.main.initializeGlobals(main.java:320)
at b4a.example.main.afterFirstLayout(main.java:101)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main$WaitForLayout.run(main.java:82)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6938)
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)
** Activity (main) Create, isFirst = true **

I had a look at the forums, but I didn't understand why it happens here. I use the same code for all my starter modules, but for this one, it's the first time i'm blocked.
The USB fonction is OK.
How can I do ? The breakpoint 'if false...' doesn't give any answer in the log, but the log tells that the problem is on line 'end sub'
 
Last edited:

DALB

Active Member
Licensed User
if I delete this little sub, the error appears again !
if I delete all the codes between the sub ... end sub, the problem remains !
 
Upvote 0

DALB

Active Member
Licensed User
Thank for coming, mw1

this 'If False.. is build with a breakpoint to see what message is delivered by the log.
Now, I've tried many thing, up to restart my PC, but it doesn't changed.
If I launch my other apps with the same Starter Module, they work fine !
 
Upvote 0

DALB

Active Member
Licensed User
Thank Erel,
I've not seen where it was because I only build 2 activities. But recreating the app makes it running well.
 
Upvote 0
Top