Hello i get this error:
with this code:
B4X:
Error occurred on line: 168 (Main)
Method not found: GetInputStream, target: [_success=1, _jobname=dbDownloader, _username=
, _password=, _errormessage=, _target=<b4i_main: (null)>
, _req=<B4IHttpRequest: <NSMutableURLRequest: 0x17ed21d0> { URL: myurl }>, _tag=<NSObject: 0x17ed27a0>, _res=<B4IHttpResponse: 0x17ed76b0>
, _main=<b4i_main: (null)>, _httputils2service=<b4i_httputils2service: (null)>]
Stack Trace: (
CoreFoundation <redacted> + 150
libobjc.A.dylib objc_exception_throw + 38
CoreFoundation <redacted> + 0
Lulaj +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 426
Lulaj -[B4IShell runMethod:] + 574
Lulaj -[B4IShell raiseEventImpl:method:args::] + 1998
Lulaj -[B4IShellBI raiseEvent:event:params:] + 1442
Lulaj +[B4IDebug delegate:::] + 52
Lulaj -[b4i_main _jobdone:] + 400
CoreFoundation <redacted> + 68
CoreFoundation <redacted> + 292
Lulaj +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1786
Lulaj -[B4ICommon CallSubDebug4::::] + 940
Lulaj -[B4ICommon CallSubDebug2::::] + 254
Lulaj -[b4i_httpjob _complete::] + 992
Lulaj -[b4i_httputils2service _completejob::::] + 1680
Lulaj -[b4i_httputils2service _hc_responsesuccess::] + 1104
CoreFoundation <redacted> + 68
CoreFoundation <redacted> + 292
Lulaj +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1786
Lulaj -[B4IShell runMethod:] + 574
Lulaj -[B4IShell raiseEventImpl:method:args::] + 2212
Lulaj -[B4IShellBI raiseEvent:event:params:] + 1442
Lulaj __61-[B4IHttp URLSession:downloadTask:didFinishDownloadingToURL:]_block_invoke + 240
libdispatch.dylib <redacted> + 498
libdispatch.dylib <redacted> + 22
libdispatch.dylib _dispatch_main_queue_callback_4CF + 1532
CoreFoundation <redacted> + 8
CoreFoundation <redacted> + 1590
CoreFoundation CFRunLoopRunSpecific + 516
CoreFoundation CFRunLoopRunInMode + 108
GraphicsServices GSEventRunModal + 160
UIKit UIApplicationMain + 144
Lulaj main + 108
libdyld.dylib <redacted> + 2
)
with this code:
B4X:
Public Sub JobDone (Job As HttpResponse)
Dim b() As Byte=Bit.InputStreamToBytes(Job.GetInputStream)
Dim out As OutputStream=File.OpenOutput(File.DirDocuments,"database.sqlite",False)
out.WriteBytes(b,0,b.Length)
out.Close
File.Copy(File.DirDocuments,"database.sqlite",File.DirDocuments, "database_offline.sqlite")
End Sub