I feel a bit like chicken little - running around the barnyard screaming "the sky is falling".
This has to be a bug - or at least better be for my own sanity.
If you run this code in debug mode:
The IDE log says:
Which is what you would expect, given the files in the projects assets.
If you delete the installed Bug app from the phone, uncomment the 2 Log statements in Page1_resize and then run it in release mode it dies a nasty death at the statement:
If Not(File.IsDirectory(File.DirAssets, wrk_str)) Then
The B4iLogger saying:
Additional information - if you reconfigure the last couple of lines as follows:
And run it again in release mode, the B4iLogger says:
Which is decidedly not what is in the assets of the project.
Please tell me this is a bug...
This has to be a bug - or at least better be for my own sanity.
If you run this code in debug mode:
B4X:
#Region Project Attributes
#ApplicationLabel: Bug
#Version: 1.0.0
'Orientation possible values: Portrait, LandscapeLeft, LandscapeRight and PortraitUpsideDown
#iPhoneOrientations: Portrait, LandscapeLeft, LandscapeRight
#iPadOrientations: Portrait, LandscapeLeft, LandscapeRight, PortraitUpsideDown
#Target: iPhone, iPad
#ATSEnabled: True
#MinVersion: 7
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'Public variables can be accessed from all modules.
Public App As Application
Public NavControl As NavigationController
Private Page1 As Page
End Sub
Private Sub Application_Start (Nav As NavigationController)
Dim rl As ReleaseLogger
rl.Initialize("192.168.1.6", 54323)
NavControl = Nav
Page1.Initialize("Page1")
Page1.Title = "Page 1"
Page1.RootPanel.Color = Colors.White
NavControl.ShowPage(Page1)
End Sub
Private Sub Page1_Resize(Width As Int, Height As Int)
Private wrk_files As List
Private wrk_str As String
Private wrk_ptr As Int
'Get names of files in assets directory
wrk_files = File.ListFiles(File.DirAssets)
'For all files...
For wrk_ptr = 0 To wrk_files.Size - 1
'Get a file name
wrk_str = wrk_files.Get(wrk_ptr)
'Log(1)
'If not another directory...
If Not(File.IsDirectory(File.DirAssets, wrk_str)) Then
'Log(2)
Log(wrk_str)
End If
Next
End Sub
The IDE log says:
Application_Start
Ignoring release logger in debug mode.
Application_Active
_assets_map
beep.mp3
radiobutton_off.png
radiobutton_on.png
wmm2010.cof
wmm2015.cof
Which is what you would expect, given the files in the projects assets.
If you delete the installed Bug app from the phone, uncomment the 2 Log statements in Page1_resize and then run it in release mode it dies a nasty death at the statement:
If Not(File.IsDirectory(File.DirAssets, wrk_str)) Then
The B4iLogger saying:
1
Error getting attributes: Error Domain=NSCocoaErrorDomain Code=260 "The file ?bug? couldn?t be opened because there is no such file." UserInfo={NSFilePath=/var/containers/Bundle/Application/EF720F73-8649-48C5-A294-FDE144B3F99F/Bug.app/bug, NSUnderlyingError=0x15e34450 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
Stack Trace: (
CoreFoundation <redacted> + 152
libobjc.A.dylib objc_exception_throw + 38
CoreFoundation <redacted> + 0
Bug -[B4IFile GetAttributes::] + 426
Bug -[B4IFile IsDirectory::] + 90
Bug -[b4i_main _page1_resize::] + 1224
CoreFoundation <redacted> + 68
CoreFoundation <redacted> + 300
Bug +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1784
Bug -[B4I raiseEvent:eventarams:] + 634
Bug +[B4IObjectWrapper raiseEvent:::] + 220
Bug __30-[B4IPanelView layoutSubviews]_block_invoke + 1040
libdispatch.dylib <redacted> + 10
libdispatch.dylib <redacted> + 22
libdispatch.dylib _dispatch_main_queue_callback_4CF + 902
CoreFoundation <redacted> + 8
CoreFoundation <redacted> + 848
CoreFoundation CFRunLoopRunSpecific + 470
CoreFoundation CFRunLoopRunInMode + 104
GraphicsServices GSEventRunModal + 80
UIKit UIApplicationMain + 150
Bug main + 106
libdyld.dylib <redacted> + 2
)
Additional information - if you reconfigure the last couple of lines as follows:
B4X:
'For all files...
For wrk_ptr = 0 To wrk_files.Size - 1
'Get a file name
wrk_str = wrk_files.Get(wrk_ptr)
'Log(1)
'If not another directory...
'If Not(File.IsDirectory(File.DirAssets, wrk_str)) Then
'Log(2)
Log(wrk_str)
'End If
Next
And run it again in release mode, the B4iLogger says:
Bug
[email protected]
[email protected]
[email protected]
Default-Portrait.png
[email protected]
[email protected]
Info.plist
PkgInfo
_CodeSignature
beep.mp3
consolas-bold.ttf
consolas.ttf
embedded.mobileprovision
icon-60.png
[email protected]
icon-76.png
[email protected]
radiobutton_off.png
radiobutton_on.png
wmm2010.cof
wmm2015.cof
Which is decidedly not what is in the assets of the project.
Please tell me this is a bug...
Attachments
Last edited: