Android Question Error in starter Service - Rapid Debugger

JTmartins

Active Member
Licensed User
Longtime User
I just started a new project and add a few lines of code to do some tests.

In Rapid Debug mode I always get this error, but in legacy debug or release, the project runs OK in the tablet.

Why wonder what is causing this error in this little piece of code.

I havent touched starter service and never had this before.

ERROR

java.lang.RuntimeException: Unable to create service gesboot.gescola.pt.starter: java.lang.RuntimeException: java.lang.NullPointerException
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2742)
at android.app.ActivityThread.access$1800(ActivityThread.java:152)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1404)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5299)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:830)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:646)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
at anywheresoftware.b4a.shell.Shell.virtualAssets(Shell.java:167)
at anywheresoftware.b4a.shell.Shell.start(Shell.java:99)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:88)
at gesboot.gescola.pt.starter.onCreate(starter.java:32)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2732)
... 10 more
Caused by: java.lang.NullPointerException
at anywheresoftware.b4a.shell.ShellConnector.sendControlMessage(ShellConnector.java:61)
at anywheresoftware.b4a.shell.Shell.virtualAssets(Shell.java:127)
... 14 more

Code :

B4X:
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
   

End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Private bootVideo As VideoView
   
End Sub

Sub Activity_Create(FirstTime As Boolean)
    Private FileStatus As Boolean
    'Do not forget to load the layout file created with the visual designer. For example:
    If FirstTime=True Then
        If File.Exists(File.DirRootExternal,"gesboot.mp4")=False Then
            File.Copy(File.DirAssets,"gesboot.mp4",File.DirRootExternal,"gesboot.mp4")
        End If   
    End If
    ' Para modo imersivo   

    Activity.LoadLayout("boot1")
    VideoBootPlay
    ' Check all folders
    FileStatus=bootUtils.Filechecker
End Sub

Sub Activity_Resume

   
End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub


Sub VideoBootPlay
    bootVideo.Initialize("bootVideo")
    bootVideo.MediaControllerEnabled=False
    Dim VideoViewRelativeLayout1 As VideoViewRelativeLayout
    VideoViewRelativeLayout1.Initialize
    VideoViewRelativeLayout1.SetVideoView(bootVideo)
    Activity.AddView(VideoViewRelativeLayout1, 1dip, 1dip, Activity.Width, Activity.Height)
    bootVideo.LoadVideo(File.DirRootExternal, "gesboot.mp4")
    bootVideo.Play
   
End Sub

Many Thanks.
JM
 

JTmartins

Active Member
Licensed User
Longtime User
Sorry for the delay in the reply Erel.

Never mind. I found the reason. It was related with a litle piece of code underneath the mentioned one, and that handled the imersive mode.

For some reason, with code for imersive mode, the rapid debugger always fails.

Many thanks for your concern.

JM
 
Upvote 0
Top