Other Compiler error: file not found [solved]

igodese

Member
Licensed User
Hi all, this morning I have a strange behaviour compiling my new App with the hosted builder. Note that the source file is identical to the one I compiled successfully yesterday.
I have such declaration in "Globals":
B4X:
    Dim fload As Bitmap ' file load background
and this code in "Application_Start":
B4X:
    fload = LoadBitmap(File.DirAssets, "from-disc.png")
When compiling, I receive this error (note that line #235 is the bitmap load):
Application_Start
Error loading bitmap: Error opening stream: Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" UserInfo={_kCFStreamErrorCodeKey=2, _kCFStreamErrorDomainKey=1}
Error loading bitmap: Error opening stream: Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" UserInfo={_kCFStreamErrorCodeKey=2, _kCFStreamErrorDomainKey=1}
Error loading bitmap: Error opening stream: Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" UserInfo={_kCFStreamErrorCodeKey=2, _kCFStreamErrorDomainKey=1}
Error loading bitmap: Error opening stream: Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" UserInfo={_kCFStreamErrorCodeKey=2, _kCFStreamErrorDomainKey=1}
Error loading bitmap: Error opening stream: Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" UserInfo={_kCFStreamErrorCodeKey=2, _kCFStreamErrorDomainKey=1}
Error loading bitmap: Error opening stream: Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" UserInfo={_kCFStreamErrorCodeKey=2, _kCFStreamErrorDomainKey=1}
Error loading bitmap: Error opening stream: Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" UserInfo={_kCFStreamErrorCodeKey=2, _kCFStreamErrorDomainKey=1}
Error loading bitmap: Error opening stream: Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" UserInfo={_kCFStreamErrorCodeKey=2, _kCFStreamErrorDomainKey=1}
Error loading bitmap: Error opening stream: Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" UserInfo={_kCFStreamErrorCodeKey=2, _kCFStreamErrorDomainKey=1}
Error loading bitmap: Error opening stream: Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" UserInfo={_kCFStreamErrorCodeKey=2, _kCFStreamErrorDomainKey=1}
Error loading bitmap: Error opening stream: Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" UserInfo={_kCFStreamErrorCodeKey=2, _kCFStreamErrorDomainKey=1}
Error loading bitmap: Error opening stream: Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" UserInfo={_kCFStreamErrorCodeKey=2, _kCFStreamErrorDomainKey=1}
Error loading bitmap: Error opening stream: Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" UserInfo={_kCFStreamErrorCodeKey=2, _kCFStreamErrorDomainKey=1}
Error loading bitmap: Error opening stream: Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" UserInfo={_kCFStreamErrorCodeKey=2, _kCFStreamErrorDomainKey=1}
Error loading bitmap: Error opening stream: Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" UserInfo={_kCFStreamErrorCodeKey=2, _kCFStreamErrorDomainKey=1}
Error loading bitmap: Error opening stream: Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" UserInfo={_kCFStreamErrorCodeKey=2, _kCFStreamErrorDomainKey=1}
Error loading bitmap: Error opening stream: Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" UserInfo={_kCFStreamErrorCodeKey=2, _kCFStreamErrorDomainKey=1}
Error loading bitmap: Error opening stream: Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" UserInfo={_kCFStreamErrorCodeKey=2, _kCFStreamErrorDomainKey=1}
Error loading bitmap: Error opening stream: Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" UserInfo={_kCFStreamErrorCodeKey=2, _kCFStreamErrorDomainKey=1}
Error loading bitmap: Error opening stream: Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" UserInfo={_kCFStreamErrorCodeKey=2, _kCFStreamErrorDomainKey=1}
Error occurred on line: 235 (Main)
Error opening stream: Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" UserInfo={_kCFStreamErrorCodeKey=2, _kCFStreamErrorDomainKey=1}
Stack Trace: (
CoreFoundation <redacted> + 252
libobjc.A.dylib objc_exception_throw + 56
CoreFoundation <redacted> + 0
OR952DI -[B4IFile OpenInput::] + 436
OR952DI -[B4IBitmap Initialize::] + 796
OR952DI -[B4ICommon LoadBitmap::] + 136
OR952DI -[b4i_main _application_start:] + 7424
CoreFoundation <redacted> + 144
CoreFoundation <redacted> + 284
OR952DI +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1624
OR952DI -[B4IShell runMethod:] + 448
OR952DI -[B4IShell raiseEventImpl:method:args::] + 1784
OR952DI -[B4IShellBI raiseEvent:event:params:] + 1408
OR952DI __33-[B4I raiseUIEvent:event:params:]_block_invoke + 60
libdispatch.dylib <redacted> + 24
libdispatch.dylib <redacted> + 16
libdispatch.dylib <redacted> + 1012
CoreFoundation <redacted> + 12
CoreFoundation <redacted> + 2272
CoreFoundation CFRunLoopRunSpecific + 552
GraphicsServices GSEventRunModal + 100
UIKit UIApplicationMain + 236
OR952DI main + 124
libdyld.dylib <redacted> + 4
)
Note that all files needed by the App are stored in the correct "Files" folder. Also note that this problem arised just this morning. Yesterday all was fine. I doubt that someone could have modified my environment during the night!
Any help will be welcome.
Thank you.
 
Last edited:

igodese

Member
Licensed User
It worked!
Thanks to both of you.

Probably, when you turn off the iPhone with an App loaded in debug mode, the folders involved are "locked" in some way. When you turn on again the phone "the day after", such lock prevents the use of the files in the "old folder". May be that a new one is created, but you can't use it until you don't remove the older by uninstalling the App.
This is just my opinion, no proofs that is correct!
 
Last edited:
Upvote 0
Top