Stacktrace, maybe Error in HTTPUtilsService

optimist

Member
Licensed User
Longtime User
Hello,
i my developer view in android appstore i found an stacktrace.
it is anonymous, so i can not ask the user

but it is somehow caused near httputilsservice. I bought b4a only 2 Weeks ago. Maybe one of you can help me to figure out what may be wrong. Any Hints?

TIA



java.lang.RuntimeException: Unable to create service lilivel.b4a.b1gmailsync.httputilsservice: java.lang.RuntimeException: java.lang.NullPointerException
at android.app.ActivityThread.handleCreateService(ActivityThread.java:1955)
at android.app.ActivityThread.access$2500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:985)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3683)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
at lilivel.b4a.b1gmailsync.main.initializeProcessGlobals(main.java:534)
at lilivel.b4a.b1gmailsync.httputilsservice.onCreate(httputilsservice.java:27)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:1945)
... 10 more
Caused by: java.lang.NullPointerException
at anywheresoftware.b4a.objects.streams.File.getDirInternalCache(File.java:55)
at lilivel.b4a.b1gmailsync.httputilsservice._process_globals(httputilsservice.java:140)
at lilivel.b4a.b1gmailsync.main.initializeProcessGlobals(main.java:527)
... 12 more
 

optimist

Member
Licensed User
Longtime User
Solved

Hello,
found the Solution myself in another Thread.

HTTPUtilsServ should be patched. Here is the patched code (original lines from 10-25)

B4X:
   Dim TempFolder As String
   'TempFolder = File.DirInternalCache   '<-----removed
   Dim Post As Boolean
   Dim PostBytes() As Byte
   Dim PostInputStream As InputStream
   Dim PostLength As Int
End Sub
Sub Service_Create
        If TempFolder = "" Then TempFolder = File.DirInternalCache   '<-----new
   hc.Initialize("hc")
End Sub

Sub Service_Start
    If HttpUtils.Tasks.IsInitialized = False Then Return  '<-----new
    taskToRequest.Initialize
    finishTasks = 0
 
Upvote 0
Top