iOS Question Error in CopyDBFromAssets

RVP

Active Member
Licensed User
I am trying to copy a database file

B4X:
    Dim DbFileName As String : DbFileName = "Lights.db"

...

If File.Exists(File.DirDocuments,DbFileName) = False Then
        DBUtils.CopyDBFromAssets(DbFileName)
    End If

Lights.db exists and is in my Files manager.

I get the following when the copy is attempted

B4X:
dbutils process globals
Application_Start
Error occurred on line: 25 (DBUtils)
Error copying file: Error Domain=NSCocoaErrorDomain Code=260 "The operation couldn’t be completed. (Cocoa error 260.)" UserInfo=0x14ec8000 {NSFilePath=/private/var/mobile/Containers/Data/Application/BF0F1BAD-6EDD-4F33-93D5-D2AB163160F3/tmp/virtual_assets/lights.db, NSUnderlyingError=0x14ec7a50 "The operation couldn’t be completed. No such file or directory"}
Stack Trace: (
  CoreFoundation       <redacted> + 150
  libobjc.A.dylib      objc_exception_throw + 38
  CoreFoundation       <redacted> + 0
  GafferProLighting    -[B4IFile Copy::::] + 716
  CoreFoundation       <redacted> + 68
  CoreFoundation       <redacted> + 300
  GafferProLighting    +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1788
  GafferProLighting    -[B4IShell runVoidMethod] + 210
  GafferProLighting    -[B4IShell raiseEventImpl:method:args::] + 1924
  GafferProLighting    -[B4IShellBI raiseEvent:event:params:] + 1332
 GafferProLighting    __33-[B4I raiseUIEvent:event:params:]_block_invoke + 74
 libdispatch.dylib    <redacted> + 10
 libdispatch.dylib    <redacted> + 22
 libdispatch.dylib    _dispatch_main_queue_callback_4CF + 1330
 CoreFoundation       <redacted> + 8
 CoreFoundation       <redacted> + 1512
 CoreFoundation       CFRunLoopRunSpecific + 476
 CoreFoundation       CFRunLoopRunInMode + 106
 GraphicsServices     GSEventRunModal + 136
 UIKit                UIApplicationMain + 1440
 GafferProLighting    main + 108
 libdyld.dylib        <redacted> + 2
)
 
Top