Black Screen at Apple, works fine on my end.

I have an app completed and working on the simulator and in my iPhone. Apple has rejected it because it loads to a black screen and nothing else. I saw a reference to it possibly being either plugins or variables, but unless using the microphone counts as a plugin, I’m good in that respect and as far as I can tell it’s not a variables thing. 

Any obvious gotchas you kind, kind folks could point me toward?

Thanks!

Contact Apple’s testers (there should be information in the rejection email) and ask them to send you the device’s console log.  That way you can look for whatever error showed up.

Rob

Just an idea - no proof.

What is your default image?

I have read some developers just provide a blank image (black / white) and then do something splashy later.

Something i was thinking about doing.

T.

Similar problem here. Moreover, they claim that the black screen appears after several scenes of the game have appeared normally.

I am completely unable to replicate apple’s “black screen” locally. I am now testing with the latest nightly of Corona. The app works well with the Xcode simulator .

This is the console log from my device as seen in Xcode. No crashes, nothing really disturbing. Ideas anybody?

=========================

Jul 23 11:04:29 Krasens-iPad kernel[0] <Debug>: launchd[834] Container: /private/var/mobile/Applications/4A8BC7CA-6CCE-44A1-AF60-584218B8892D (sandbox)

Jul 23 11:04:29 Krasens-iPad backboardd[28] <Error>: HID: The ‘Passive’ connection ‘FWOrigins’ access to protected services is denied.

Jul 23 11:04:29 Krasens-iPad FWOrigins[834] <Warning>: Platform: iPad / iPad3,6 / 7.1.2 / PowerVR SGX 554 / OpenGL ES 2.0 IMGSGX554-97.7 / 2014.2374

Jul 23 11:04:29 Krasens-iPad SpringBoard[33] <Warning>: No valid ‘aps-environment’ entitlement string found for application ‘FW Origins’: (null). Notifications will not be delivered.

Jul 23 11:04:30 Krasens-iPad FWOrigins[834] <Warning>: play music

Jul 23 11:04:30 Krasens-iPad FWOrigins[834] <Warning>: AppDelegate.mm: didFailToRegisterForRemoteNotificationsWithError: no valid ‘aps-environment’ entitlement string found for application

Jul 23 11:04:35 Krasens-iPad deleted[553] <Error>: 0x3c7000 purgeable: no attribute in error : 2 : No such file or directory

Jul 23 11:04:35 Krasens-iPad deleted[553] <Error>: 0x3c7000 purgeable: no attribute in last_exception : 2 : No such file or directory

Jul 23 11:04:36 Krasens-iPad mobileassetd[108] <Error>: mobileassetd - _ASAssetDeletionPriorityAtDate: Unexpected value for keys __LastAccessDate, __InstallDate

Jul 23 11:04:36 Krasens-iPad mobileassetd[108] <Error>: mobileassetd - _ASAssetDeletionPriorityAtDate: Unexpected value for keys __LastAccessDate, __InstallDate

Jul 23 11:04:36 Krasens-iPad medialibraryd[212] <Warning>: {MediaLibrary} [MLWriter] ending transaction <__NSConcreteUUID 0x17e2caa0> E1A42B4F-EDB6-44D2-9525-AB9CBDCB3523. shouldCommit=0.

Jul 23 11:04:36 Krasens-iPad librariand[222] <Error>: ubiquity account is not configured (or is disabled for this client), not creating collection

Jul 23 11:04:36 Krasens-iPad librariand[222] <Error>: error in _handle_client_request: LibrarianErrorDomain/10/Unable to configure the collection.

Jul 23 11:04:36 Krasens-iPad deleted[553] <Error>: 0x479000 __DeleteLibrarian_block_invoke: unable to determine evictable space: The operation couldn’t be completed. (LibrarianErrorDomain error 10 - Unable to configure the collection.)

Jul 23 11:04:50 Krasens-iPad FWOrigins[834] <Warning>: Button Width: 403.38 Button Height: 54

Jul 23 11:04:50 Krasens-iPad FWOrigins[834] <Warning>: Label Width: 404.0625 Label Height: 36.5625

Jul 23 11:04:50 Krasens-iPad FWOrigins[834] <Warning>: Button Width: 403.38 Button Height: 54

Jul 23 11:04:50 Krasens-iPad FWOrigins[834] <Warning>: Label Width: 404.0625 Label Height: 36.5625

Jul 23 11:04:51 Krasens-iPad FWOrigins[834] <Warning>: file does not exist /var/mobile/Applications/4A8BC7CA-6CCE-44A1-AF60-584218B8892D/Documents/gameSave.json: No such file or directory

Jul 23 11:04:53 Krasens-iPad mstreamd[833] <Notice>: (Note ) mstreamd: Not monitoring for external power.

Jul 23 11:04:53 Krasens-iPad mstreamd[833] <Notice>: (Note ) PS: Media stream daemon stopping.

Jul 23 11:04:53 Krasens-iPad mstreamd[833] <Notice>: (Note ) AS: <MSIOSAlbumSharingDaemon: 0x1466dae0>: Shared Streams daemon has shut down.

Jul 23 11:04:53 Krasens-iPad mstreamd[833] <Notice>: (Warn ) mstreamd: mstreamd shutting down.

Jul 23 11:04:53 Krasens-iPad mstreamd[835] <Notice>: (Note ) mstreamd: mstreamd starting up.

Jul 23 11:04:53 Krasens-iPad mstreamd[835] <Notice>: (Note ) PS: Media stream daemon starting…

Jul 23 11:04:58 Krasens-iPad FWOrigins[834] <Warning>: Database file removed

Jul 23 11:04:58 Krasens-iPad FWOrigins[834] <Warning>: file does not exist /var/mobile/Applications/4A8BC7CA-6CCE-44A1-AF60-584218B8892D/Documents/gameSave.json: No such file or directory

Jul 23 11:05:02 Krasens-iPad wifid[15] <Notice>: WiFi:[427795502.326762]: Client dataaccessd set type to background application

Jul 23 11:05:02 Krasens-iPad wifid[15] <Notice>: WiFi:[427795502.328485]: BG Application: Not Present, BG Daemon: Present. Daemons: UserEventAgent apsd dataaccessd sharingd dataaccessd 

Jul 23 11:05:02 Krasens-iPad wifid[15] <Notice>: WiFi:[427795502.329165]: Already connected to LazarusLong.

Jul 23 11:05:03 Krasens-iPad FWOrigins[834] <Warning>: Grid Width: 479.88 Grid Height: 360

Jul 23 11:05:03 Krasens-iPad wifid[15] <Notice>: WiFi:[427795503.096262]: Client dataaccessd set type to background application

Jul 23 11:05:04 Krasens-iPad wifid[15] <Notice>: WiFi:[427795504.193220]: Client dataaccessd set type to normal application

Jul 23 11:05:04 Krasens-iPad wifid[15] <Notice>: WiFi:[427795504.195028]: BG Application: Not Present, BG Daemon: Present. Daemons: UserEventAgent apsd sharingd dataaccessd 

Jul 23 11:05:04 Krasens-iPad wifid[15] <Notice>: WiFi:[427795504.993595]: Client dataaccessd set type to normal application

Jul 23 11:05:24 Krasens-iPad medialibraryd[212] <Warning>: {MediaLibrary} [MediaLibraryService] Cancelling any active or suspended import operations in progress for process atc (process ID = 810)

Jul 23 11:05:24 Krasens-iPad medialibraryd[212] <Warning>: {MediaLibrary} [MLWriter] Cleaning up any remaining transactions for ended process atc (process ID = 810)

Jul 23 11:05:33 Krasens-iPad mstreamd[835] <Notice>: (Note ) mstreamd: Not monitoring for external power.

Jul 23 11:05:33 Krasens-iPad mstreamd[835] <Notice>: (Note ) PS: Media stream daemon stopping.

Jul 23 11:05:33 Krasens-iPad mstreamd[835] <Notice>: (Note ) AS: <MSIOSAlbumSharingDaemon: 0x14d8de20>: Shared Streams daemon has shut down.

Jul 23 11:05:33 Krasens-iPad mstreamd[835] <Notice>: (Warn ) mstreamd: mstreamd shutting down.

Jul 23 11:05:33 Krasens-iPad mstreamd[836] <Notice>: (Note ) mstreamd: mstreamd starting up.

Jul 23 11:05:33 Krasens-iPad mstreamd[836] <Notice>: (Note ) PS: Media stream daemon starting…

Jul 23 11:05:35 Krasens-iPad FWOrigins[834] <Warning>: file does not exist /var/mobile/Applications/4A8BC7CA-6CCE-44A1-AF60-584218B8892D/Documents/gameSave.json: No such file or directory

I asked Apple and they said they didn’t have any console logs to give me. I *think* I chased down the error, though: if I deleted the settings file I had, it would throw up several errors, so it looks like the error was that I wasn’t handling the first-run situation correctly. That’s weird since it still worked on my device, but I was able to get a black screen that Apple should’ve seen.

So I’m resubmitting it. Fingers crossed…

Krasen, the last line in your log output is about a json file that isn’t there; might you be having the same issue?

\>\>&nbsp;\<Warning\>: file does not exist&nbsp;/var/mobile/Applications/4A8BC7CA-6CCE-44A1-AF60-584218B8892D/Documents/gameSave.json: No such file or directory

That could be causing issues (depending on your logic and error handling)

Thank you all for your help. Gremlin, I double checked a lot of examples before doing it this way. I am going to post the code so that you see the context. Am I handling this the wrong way?


function gameCore:savedGameFileExists()

  local path = system.pathForFile(“gameSave.json”, system.DocumentsDirectory);

  local fileHandle, reason = io.open( path, “r” );

 

  local fileExists = false;

 

  if (fileHandle ~= nil) then

    fileExists = true;

    io.close( fileHandle );

  end

 

  return fileExists;

end


That is a valid way of checking for the existence of a file, however, if you are doing something like:

if gameCore:savedFileExists() then

  local path = system.pathForFile(“gameSave.json”, system.DocumentsDirectory);

  local fileHandle, reason = io.open( path, “r” );

 

   local content = fileHandle.read("*a")

   io.close(fileHandle)

   return content

end

 

Then you’re having to open and close the file twice.   Why not simply try to open the file for read, if it exists, load the file, if not initialize your base line data that you’re trying to read.

 

Here is what I do:

function saveTable(t, filename) &nbsp;&nbsp;&nbsp; local path = system.pathForFile( filename, system.DocumentsDirectory) &nbsp;&nbsp;&nbsp; local file = io.open(path, "w") &nbsp;&nbsp;&nbsp; --print("in saveTable.&nbsp; I think my table is....") &nbsp;&nbsp;&nbsp; --M.print\_r(t) &nbsp;&nbsp;&nbsp; if file then &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; local contents = json.encode(t) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --print("json data is") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --print("\*" .. contents .. "\*") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; file:write( contents ) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; io.close( file ) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return true &nbsp;&nbsp;&nbsp; else &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return false &nbsp;&nbsp;&nbsp; end end &nbsp; function loadTable(filename) &nbsp;&nbsp;&nbsp; local path = system.pathForFile( filename, system.DocumentsDirectory) &nbsp;&nbsp;&nbsp; local contents = "" &nbsp;&nbsp;&nbsp; local myTable = {} &nbsp;&nbsp;&nbsp; local file = io.open( path, "r" ) &nbsp;&nbsp;&nbsp; if file then &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --print("trying to read ", filename) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- read all contents of file into a string &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; local contents = file:read( "\*a" ) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; myTable = json.decode(contents); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; io.close( file ) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --print("Loaded file") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return myTable &nbsp;&nbsp;&nbsp; end &nbsp;&nbsp;&nbsp; print(filename, "file not found") &nbsp;&nbsp;&nbsp; return nil end &nbsp; myData.settings = loadTable("settings.json") if myData.settings == nil then &nbsp;&nbsp; &nbsp;myData.settings = {} &nbsp;&nbsp; &nbsp;myData.settings.soundOn = true &nbsp;&nbsp; &nbsp;myData.settings.musicOn = true &nbsp;&nbsp; &nbsp;myData.settings.energy = 0 &nbsp;&nbsp; &nbsp;myData.settings.currentLevel = 1 &nbsp;&nbsp; &nbsp;myData.settings.unlockedLevels = 1 &nbsp;&nbsp; &nbsp;myData.settings.levels = {} &nbsp;&nbsp;&nbsp; saveTable(myData.settings, "settings.json") end

 

Also just checking the file doesn’t mean the rest of your app is actually handling things properly.   Even my method above has been causing me problems because I’ll add a new key to my settings table and then forget to delete the settings file.  Since I get a valid settings file back, everything is good, except for missing keys.

 

Rob

So, this turned out to be another one of those “no sh**t there I was” stories. 

After I bombarder Apple (both tech and review teams) with emails about the logs and how I need them and how there is no way I can replicate this even after following all directions … they started the review process again. I figure that they might have done that in order to get the logs. I am not sure.

Anyway, the app passed. The very same app that they claimed had problems. So, after all is said and done, all ends well on this step.

Guys, thank you for you time and for your advice.

Contact Apple’s testers (there should be information in the rejection email) and ask them to send you the device’s console log.  That way you can look for whatever error showed up.

Rob

Just an idea - no proof.

What is your default image?

I have read some developers just provide a blank image (black / white) and then do something splashy later.

Something i was thinking about doing.

T.

Similar problem here. Moreover, they claim that the black screen appears after several scenes of the game have appeared normally.

I am completely unable to replicate apple’s “black screen” locally. I am now testing with the latest nightly of Corona. The app works well with the Xcode simulator .

This is the console log from my device as seen in Xcode. No crashes, nothing really disturbing. Ideas anybody?

=========================

Jul 23 11:04:29 Krasens-iPad kernel[0] <Debug>: launchd[834] Container: /private/var/mobile/Applications/4A8BC7CA-6CCE-44A1-AF60-584218B8892D (sandbox)

Jul 23 11:04:29 Krasens-iPad backboardd[28] <Error>: HID: The ‘Passive’ connection ‘FWOrigins’ access to protected services is denied.

Jul 23 11:04:29 Krasens-iPad FWOrigins[834] <Warning>: Platform: iPad / iPad3,6 / 7.1.2 / PowerVR SGX 554 / OpenGL ES 2.0 IMGSGX554-97.7 / 2014.2374

Jul 23 11:04:29 Krasens-iPad SpringBoard[33] <Warning>: No valid ‘aps-environment’ entitlement string found for application ‘FW Origins’: (null). Notifications will not be delivered.

Jul 23 11:04:30 Krasens-iPad FWOrigins[834] <Warning>: play music

Jul 23 11:04:30 Krasens-iPad FWOrigins[834] <Warning>: AppDelegate.mm: didFailToRegisterForRemoteNotificationsWithError: no valid ‘aps-environment’ entitlement string found for application

Jul 23 11:04:35 Krasens-iPad deleted[553] <Error>: 0x3c7000 purgeable: no attribute in error : 2 : No such file or directory

Jul 23 11:04:35 Krasens-iPad deleted[553] <Error>: 0x3c7000 purgeable: no attribute in last_exception : 2 : No such file or directory

Jul 23 11:04:36 Krasens-iPad mobileassetd[108] <Error>: mobileassetd - _ASAssetDeletionPriorityAtDate: Unexpected value for keys __LastAccessDate, __InstallDate

Jul 23 11:04:36 Krasens-iPad mobileassetd[108] <Error>: mobileassetd - _ASAssetDeletionPriorityAtDate: Unexpected value for keys __LastAccessDate, __InstallDate

Jul 23 11:04:36 Krasens-iPad medialibraryd[212] <Warning>: {MediaLibrary} [MLWriter] ending transaction <__NSConcreteUUID 0x17e2caa0> E1A42B4F-EDB6-44D2-9525-AB9CBDCB3523. shouldCommit=0.

Jul 23 11:04:36 Krasens-iPad librariand[222] <Error>: ubiquity account is not configured (or is disabled for this client), not creating collection

Jul 23 11:04:36 Krasens-iPad librariand[222] <Error>: error in _handle_client_request: LibrarianErrorDomain/10/Unable to configure the collection.

Jul 23 11:04:36 Krasens-iPad deleted[553] <Error>: 0x479000 __DeleteLibrarian_block_invoke: unable to determine evictable space: The operation couldn’t be completed. (LibrarianErrorDomain error 10 - Unable to configure the collection.)

Jul 23 11:04:50 Krasens-iPad FWOrigins[834] <Warning>: Button Width: 403.38 Button Height: 54

Jul 23 11:04:50 Krasens-iPad FWOrigins[834] <Warning>: Label Width: 404.0625 Label Height: 36.5625

Jul 23 11:04:50 Krasens-iPad FWOrigins[834] <Warning>: Button Width: 403.38 Button Height: 54

Jul 23 11:04:50 Krasens-iPad FWOrigins[834] <Warning>: Label Width: 404.0625 Label Height: 36.5625

Jul 23 11:04:51 Krasens-iPad FWOrigins[834] <Warning>: file does not exist /var/mobile/Applications/4A8BC7CA-6CCE-44A1-AF60-584218B8892D/Documents/gameSave.json: No such file or directory

Jul 23 11:04:53 Krasens-iPad mstreamd[833] <Notice>: (Note ) mstreamd: Not monitoring for external power.

Jul 23 11:04:53 Krasens-iPad mstreamd[833] <Notice>: (Note ) PS: Media stream daemon stopping.

Jul 23 11:04:53 Krasens-iPad mstreamd[833] <Notice>: (Note ) AS: <MSIOSAlbumSharingDaemon: 0x1466dae0>: Shared Streams daemon has shut down.

Jul 23 11:04:53 Krasens-iPad mstreamd[833] <Notice>: (Warn ) mstreamd: mstreamd shutting down.

Jul 23 11:04:53 Krasens-iPad mstreamd[835] <Notice>: (Note ) mstreamd: mstreamd starting up.

Jul 23 11:04:53 Krasens-iPad mstreamd[835] <Notice>: (Note ) PS: Media stream daemon starting…

Jul 23 11:04:58 Krasens-iPad FWOrigins[834] <Warning>: Database file removed

Jul 23 11:04:58 Krasens-iPad FWOrigins[834] <Warning>: file does not exist /var/mobile/Applications/4A8BC7CA-6CCE-44A1-AF60-584218B8892D/Documents/gameSave.json: No such file or directory

Jul 23 11:05:02 Krasens-iPad wifid[15] <Notice>: WiFi:[427795502.326762]: Client dataaccessd set type to background application

Jul 23 11:05:02 Krasens-iPad wifid[15] <Notice>: WiFi:[427795502.328485]: BG Application: Not Present, BG Daemon: Present. Daemons: UserEventAgent apsd dataaccessd sharingd dataaccessd 

Jul 23 11:05:02 Krasens-iPad wifid[15] <Notice>: WiFi:[427795502.329165]: Already connected to LazarusLong.

Jul 23 11:05:03 Krasens-iPad FWOrigins[834] <Warning>: Grid Width: 479.88 Grid Height: 360

Jul 23 11:05:03 Krasens-iPad wifid[15] <Notice>: WiFi:[427795503.096262]: Client dataaccessd set type to background application

Jul 23 11:05:04 Krasens-iPad wifid[15] <Notice>: WiFi:[427795504.193220]: Client dataaccessd set type to normal application

Jul 23 11:05:04 Krasens-iPad wifid[15] <Notice>: WiFi:[427795504.195028]: BG Application: Not Present, BG Daemon: Present. Daemons: UserEventAgent apsd sharingd dataaccessd 

Jul 23 11:05:04 Krasens-iPad wifid[15] <Notice>: WiFi:[427795504.993595]: Client dataaccessd set type to normal application

Jul 23 11:05:24 Krasens-iPad medialibraryd[212] <Warning>: {MediaLibrary} [MediaLibraryService] Cancelling any active or suspended import operations in progress for process atc (process ID = 810)

Jul 23 11:05:24 Krasens-iPad medialibraryd[212] <Warning>: {MediaLibrary} [MLWriter] Cleaning up any remaining transactions for ended process atc (process ID = 810)

Jul 23 11:05:33 Krasens-iPad mstreamd[835] <Notice>: (Note ) mstreamd: Not monitoring for external power.

Jul 23 11:05:33 Krasens-iPad mstreamd[835] <Notice>: (Note ) PS: Media stream daemon stopping.

Jul 23 11:05:33 Krasens-iPad mstreamd[835] <Notice>: (Note ) AS: <MSIOSAlbumSharingDaemon: 0x14d8de20>: Shared Streams daemon has shut down.

Jul 23 11:05:33 Krasens-iPad mstreamd[835] <Notice>: (Warn ) mstreamd: mstreamd shutting down.

Jul 23 11:05:33 Krasens-iPad mstreamd[836] <Notice>: (Note ) mstreamd: mstreamd starting up.

Jul 23 11:05:33 Krasens-iPad mstreamd[836] <Notice>: (Note ) PS: Media stream daemon starting…

Jul 23 11:05:35 Krasens-iPad FWOrigins[834] <Warning>: file does not exist /var/mobile/Applications/4A8BC7CA-6CCE-44A1-AF60-584218B8892D/Documents/gameSave.json: No such file or directory

I asked Apple and they said they didn’t have any console logs to give me. I *think* I chased down the error, though: if I deleted the settings file I had, it would throw up several errors, so it looks like the error was that I wasn’t handling the first-run situation correctly. That’s weird since it still worked on my device, but I was able to get a black screen that Apple should’ve seen.

So I’m resubmitting it. Fingers crossed…

Krasen, the last line in your log output is about a json file that isn’t there; might you be having the same issue?

\>\>&nbsp;\<Warning\>: file does not exist&nbsp;/var/mobile/Applications/4A8BC7CA-6CCE-44A1-AF60-584218B8892D/Documents/gameSave.json: No such file or directory

That could be causing issues (depending on your logic and error handling)

Thank you all for your help. Gremlin, I double checked a lot of examples before doing it this way. I am going to post the code so that you see the context. Am I handling this the wrong way?


function gameCore:savedGameFileExists()

  local path = system.pathForFile(“gameSave.json”, system.DocumentsDirectory);

  local fileHandle, reason = io.open( path, “r” );

 

  local fileExists = false;

 

  if (fileHandle ~= nil) then

    fileExists = true;

    io.close( fileHandle );

  end

 

  return fileExists;

end


That is a valid way of checking for the existence of a file, however, if you are doing something like:

if gameCore:savedFileExists() then

  local path = system.pathForFile(“gameSave.json”, system.DocumentsDirectory);

  local fileHandle, reason = io.open( path, “r” );

 

   local content = fileHandle.read("*a")

   io.close(fileHandle)

   return content

end

 

Then you’re having to open and close the file twice.   Why not simply try to open the file for read, if it exists, load the file, if not initialize your base line data that you’re trying to read.

 

Here is what I do:

function saveTable(t, filename) &nbsp;&nbsp;&nbsp; local path = system.pathForFile( filename, system.DocumentsDirectory) &nbsp;&nbsp;&nbsp; local file = io.open(path, "w") &nbsp;&nbsp;&nbsp; --print("in saveTable.&nbsp; I think my table is....") &nbsp;&nbsp;&nbsp; --M.print\_r(t) &nbsp;&nbsp;&nbsp; if file then &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; local contents = json.encode(t) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --print("json data is") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --print("\*" .. contents .. "\*") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; file:write( contents ) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; io.close( file ) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return true &nbsp;&nbsp;&nbsp; else &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return false &nbsp;&nbsp;&nbsp; end end &nbsp; function loadTable(filename) &nbsp;&nbsp;&nbsp; local path = system.pathForFile( filename, system.DocumentsDirectory) &nbsp;&nbsp;&nbsp; local contents = "" &nbsp;&nbsp;&nbsp; local myTable = {} &nbsp;&nbsp;&nbsp; local file = io.open( path, "r" ) &nbsp;&nbsp;&nbsp; if file then &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --print("trying to read ", filename) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- read all contents of file into a string &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; local contents = file:read( "\*a" ) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; myTable = json.decode(contents); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; io.close( file ) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --print("Loaded file") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return myTable &nbsp;&nbsp;&nbsp; end &nbsp;&nbsp;&nbsp; print(filename, "file not found") &nbsp;&nbsp;&nbsp; return nil end &nbsp; myData.settings = loadTable("settings.json") if myData.settings == nil then &nbsp;&nbsp; &nbsp;myData.settings = {} &nbsp;&nbsp; &nbsp;myData.settings.soundOn = true &nbsp;&nbsp; &nbsp;myData.settings.musicOn = true &nbsp;&nbsp; &nbsp;myData.settings.energy = 0 &nbsp;&nbsp; &nbsp;myData.settings.currentLevel = 1 &nbsp;&nbsp; &nbsp;myData.settings.unlockedLevels = 1 &nbsp;&nbsp; &nbsp;myData.settings.levels = {} &nbsp;&nbsp;&nbsp; saveTable(myData.settings, "settings.json") end

 

Also just checking the file doesn’t mean the rest of your app is actually handling things properly.   Even my method above has been causing me problems because I’ll add a new key to my settings table and then forget to delete the settings file.  Since I get a valid settings file back, everything is good, except for missing keys.

 

Rob

So, this turned out to be another one of those “no sh**t there I was” stories. 

After I bombarder Apple (both tech and review teams) with emails about the logs and how I need them and how there is no way I can replicate this even after following all directions … they started the review process again. I figure that they might have done that in order to get the logs. I am not sure.

Anyway, the app passed. The very same app that they claimed had problems. So, after all is said and done, all ends well on this step.

Guys, thank you for you time and for your advice.