iOS Question Several Errors in Debug, not in Release

schimanski

Well-Known Member
Licensed User
Longtime User
Since yesterday, I have the problem, that my app runs in release, but suddenly not in debug mode. There are several exceptions. I have cleaned the project 10 times, I have deleted the app 5 times and I have deinstalled and new installed b4i-Bridge. I also tried to set back from 64bit to 32Bit and I have tried to install an old version of my app, to make sure that it is not a new modul...all that doesn't helps:

Here are two exceptions, that only are raised in debug:

B4X:
Error occurred on line: 39 (ExpandableTableView)
Object was not initialized (UIView)
Stack Trace: (
  CoreFoundation       <redacted> + 150
  libobjc.A.dylib      objc_exception_throw + 38
  CoreFoundation       <redacted> + 0
  EIS                  -[B4IObjectWrapper object] + 200
  EIS                  -[B4IViewWrapper SetLayoutAnimated::::::] + 86
  EIS                  -[b4i_neuekonferenz _pageneuekonferenz_resize::] + 1138
  CoreFoundation       <redacted> + 68
  CoreFoundation       <redacted> + 292
  EIS                  +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1786
  EIS                  -[B4IShell runMethod:] + 574
EIS                  -[B4IShell raiseEventImpl:method:args::] + 1998
EIS                  -[B4IShellBI raiseEvent:event:params:] + 1340
EIS                  +[B4IObjectWrapper raiseEvent:::] + 220
EIS                  __30-[B4IPanelView layoutSubviews]_block_invoke + 822
libdispatch.dylib    <redacted> + 10
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

B4X:
Error occurred on line: 25 (clsPMEditText)
Error opening stream: Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"
Stack Trace: (
  CoreFoundation       <redacted> + 150
  libobjc.A.dylib      objc_exception_throw + 38
  CoreFoundation       <redacted> + 0
  EIS                  -[B4IFile OpenInput::] + 508
  EIS                  -[B4IBitmap Initialize::] + 1058
  EIS                  -[B4ICommon LoadBitmap::] + 98
  EIS                  -[b4i_clspmedittext _initialize:::::::::::] + 2864
  EIS                  -[b4i_clspmcategory _addedittext0::::::::::] + 1382
  EIS                  -[b4i_clspmcategory _addedittext2:::::::::] + 1192
  EIS                  -[b4i_einstellungen _initpreference_einstellungen] + 5132
EIS                  -[b4i_einstellungen _pageeinstellungen_resize::] + 822
CoreFoundation       <redacted> + 68
CoreFoundation       <redacted> + 292
EIS                  +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1786
EIS                  -[B4IShell runMethod:] + 574
EIS                  -[B4IShell raiseEventImpl:method:args::] + 1998
EIS                  -[B4IShellBI raiseEvent:event:params:] + 1340
EIS                  +[B4IObjectWrapper raiseEvent:::] + 220
EIS                  __30-[B4IPanelView layoutSubviews]_block_invoke + 822
libdispatch.dylib    <redacted> + 10
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
EIS                  main + 108
libdyld.dylib        <redacted> + 2
)

Does anybode knows, what I can also do to solve the problem?
 

JonPM

Well-Known Member
Licensed User
Longtime User
Can you show your code surrounding the above errors (initialization of ExpandableTableView and clsPMEditText)?
 
Upvote 0

schimanski

Well-Known Member
Licensed User
Longtime User
Hello JonPM. The code is the original class of Erel's ExpandableTableView and the the clsPMEditText is the original Class of filippos Preference. The problem isn't this code, because everything runs with the same code in debug yesterday. I think, that something is crashed in the compiler settings. The same problem is often posted here and an deinstallation and new installation solved this problem, but not yet...
 
Upvote 0

JonPM

Well-Known Member
Licensed User
Longtime User
Oh do you mean with Hosted Builder? Sorry I use local so I'm not sure
 
Upvote 0

schimanski

Well-Known Member
Licensed User
Longtime User
Yes, I know that. I have uninstalled everything up to 10 times, but nothing helps. The missing bitmap is only the first exception. When I delete the line, the next bitmap in the dirassets folder isn't found in debug. I had the problem sometimes in the past and an reinstall helps every times, but now, no success...
 
Upvote 0

schimanski

Well-Known Member
Licensed User
Longtime User
Not yet. I always uninstall them, when I don't need them longer. Could a factory reset solve the problem?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
In debug mode the asset files are stored in a folder named virtual_assets. It is located in the temp folder.

Your current code deletes this folder together with the other temporary files.
Change the sub that deletes all the temporary files to:
B4X:
Sub TempFiles_loeschen
   For Each s As String In File.ListFiles(File.DirTemp)
     If File.IsDirectory(File.DirTemp, s) = False Then
       File.Delete(File.DirTemp, s)
     End If
   Next
End Sub
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I will explain how I debugged this issue.

First I added this line right before the LoadBitmap that fails:
B4X:
Log(File.ListFiles(File.DirAssets))
It failed.

So I added the same line right at the beginning of Application_Start.
This time it worked. So I understood that the folder is deleted somewhere.

The next step was to search for File.Delete.
 
Upvote 0
Top