iOS Question (SOLVED) App Suddenly stopped working

MrKim

Well-Known Member
Licensed User
Longtime User
I was cleaning up some designer scripts in a b4x pages app I am working on and the app suddenly stopped working.

It Fails in Main Page Page_Created on the last line shown here (Drawer.LeftPanel.LoadLayout("MainPageMenu"):

B4X:
Sub Class_Globals
.
.
.
    Private Drawer As B4XDrawer
.
.
.
End Sub

'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    'load the layout to Root

    Root.LoadLayout("Main")
    Dlg.Initialize (Root)
    'load MENU the layout to Root
    Drawer.Initialize(Me, "Drawer", Root, 200dip)
    Drawer.CenterPanel.LoadLayout("Main")
    Drawer.LeftPanel.LoadLayout("MainPageMenu")

Here is the error log:
B4X:
Application_Start
Error occurred on line: 224 (B4XDrawer)
Error opening stream (/private/var/mobile/Containers/Data/Application/005DF14D-2F0C-4E79-AD6B-259353DCF3E2/tmp/virtual_assets/mainpagemenu.bil): 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
  AlAPlist             -[B4IFile OpenInput::] + 440
  AlAPlist             -[B4ILayoutBuilder loadLayout:::] + 604
  AlAPlist             -[B4IPanelWrapper LoadLayout::] + 204
  AlAPlist             -[B4XViewWrapper LoadLayout::] + 100
  CoreFoundation       <redacted> + 144
  CoreFoundation       <redacted> + 292
  AlAPlist             +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1608
AlAPlist             -[B4IShell runMethod:] + 448
AlAPlist             -[B4IShell raiseEventImpl:method:args::] + 2172
AlAPlist             -[B4IShellBI raiseEvent:event:params:] + 1580
AlAPlist             +[B4IDebug delegate:::] + 80
AlAPlist             -[b4i_b4xmainpage _b4xpage_created::] + 428
CoreFoundation       <redacted> + 144
CoreFoundation       <redacted> + 292
AlAPlist             +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1608
AlAPlist             -[B4ICommon CallSubDebug4::::] + 1080
AlAPlist             -[B4ICommon CallSubDebug2::::] + 372
AlAPlist             -[b4i_b4xpagesmanager _createpageifneeded::] + 1192
AlAPlist             -[b4i_b4xpagesmanager _showpage::] + 892
AlAPlist             -[b4i_b4xpagesmanager _addpage:::] + 1584
AlAPlist             -[b4i_b4xpagesmanager _addpageandcreate:::] + 684
AlAPlist             -[b4i_b4xpagesmanager _initialize:::] + 2012
AlAPlist             -[b4i_main _application_start:] + 768
CoreFoundation       <redacted> + 144
CoreFoundation       <redacted> + 292
AlAPlist             +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1608
AlAPlist             -[B4IShell runMethod:] + 448
AlAPlist             -[B4IShell raiseEventImpl:method:args::] + 2172
AlAPlist             -[B4IShellBI raiseEvent:event:params:] + 1580
AlAPlist             __33-[B4I raiseUIEvent:event:params:]_block_invoke + 60
libdispatch.dylib    <redacted> + 24
libdispatch.dylib    <redacted> + 16
libdispatch.dylib    <redacted> + 1068
CoreFoundation       <redacted> + 12
CoreFoundation       <redacted> + 1924
CoreFoundation       CFRunLoopRunSpecific + 436
GraphicsServices     GSEventRunModal + 104
UIKitCore            UIApplicationMain + 212
AlAPlist             main + 124
libdyld.dylib        <redacted> + 4
)
I was NOT working on MainPageMenu that hasn't been changed in weeks.
I was working on Main, but nothing significant. And that line runs just fine.
The Android version of this runs just fine.

The error message comes from the Debug Version. I tried compiling a release app and it fails as well with no errors.
I cleaned the project.
I UnChecked and then Rechecked B4xDrawer(Version 1.52).
None of this helped.
Thanks for any clues.
 

Semen Matusovskiy

Well-Known Member
Licensed User
Try to isolate a problem. Create a new project, add designer scripts and a code, which you posted,
Do you see troubles ? If yes, attach this project. If not, continue to add fragments.
 
Upvote 0

MrKim

Well-Known Member
Licensed User
Longtime User
Try to isolate a problem. Create a new project, add designer scripts and a code, which you posted,
Do you see troubles ? If yes, attach this project. If not, continue to add fragments.
I will try that tomorrow. I was hoping someone might recognize something from the error log.
 
Upvote 0

MrKim

Well-Known Member
Licensed User
Longtime User
Check the file itself in the Files folder. Its name should be lowercased.
Interesting, I removed the file from the list, restored it, and put it back in and it worked. However it now fails on the very next line
B4X:
   HamburgerIcon = xui.LoadBitmapResize(File.DirAssets, "hamburger.png", 32dip, 32dip, True)
with the same error:
B4X:
Error opening stream (/private/var/mobile/Containers/Data/Application/CB885317-1ECD-4B5E-9FE5-400053FF16F0/tmp/virtual_assets/hamburger.png): Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" UserInfo={_kCFStreamErrorCodeKey=2, _kCFStreamErrorDomainKey=1}

I deleted it from files, cleaned the project, restored it, cleaned the project again, but this time no luck.
All files in Files dir are lower case.
 
Upvote 0

MrKim

Well-Known Member
Licensed User
Longtime User
Solved: I tried the obvious:
Deleted the app from the phone and reinstalled it.
 
Upvote 0
Top