Disable Corona Simulator Cache

Hi @zentemple,

Can you describe what may have changed in the past few days? Did you update the Corona build? Update to Mavericks 10.9? Change versions of Kwik? I’m hoping to narrow down a cause of this issue, considering it worked in the past year and now it’s behaving oddly.

Thanks,

Brent

AFTER the problem started I updated Corona and Kwik, just in case that was the problem. I haven’t updated anything else. 

Which build of Corona are you using now? Please check under the menu “Corona Simulator > About…”

Brent

Version 2013.1202 (2013.8.28). 2013.1202 is the version required by Kwik. I don’t understand why it is showing what would amount to a “cached” version of a page. I’m wondering if Kwik has written the code wrong. I have an email in to Alex at Kwiksher, no answer yet from Alex.

Hi @zentemple,

Please let me know what you hear back from Alex. Corona build #1202 has not been changed since it was released (in August), so different Simulator behavior in the past few days would only be occurring in Daily Builds, not #1202.

Best regards,

Brent

He is out of town until next week so I doubt I will hear from him. One more thing that might give a clue:

When I tried to preview page 1 in the same page 4 (not displaying properly) appear. In the Corona Terminal I see these lines:

"2013-10-25 13:07:55.125 Corona Simulator[2993:707] Director ERROR: Failed to execute new( params ) function on ‘page_4’.

2013-10-25 13:07:55.125 Corona Simulator[2993:707] -----------------------

2013-10-25 13:07:55.125 Corona Simulator[2993:707] …/Kwik Movies/Bluebear 1/bluebear/build/syncSound.lua:347: attempt to index local ‘talkButton’ (a nil value)"

The word “talkButton” is not mine. I don’t know where this comes from. There IS a sync sound on the page.

Update: checked the syncsound.lua line 347. The word ‘talkButton’ is there. Made me think that there was something wrong with a button. Checked the button and indeed there was a nil value in the “Tap” field.

Unfortunately, this had no effect on Corona Simulator.

Hi @zentemple,

This message points to some error in the code, with Director, which I presume Kwik is using for scene management (going from page to page). Perhaps there’s something wrong with the sound file you’re trying to play. Ultimately, I think this will have to be examined by Alex, unless it can be determined to be related to a Corona API or function, in which case I can investigate further.

Sorry I can’t be of more help at this time… maybe you can take out the sound and try a few other things to see if the error goes away, which may shed light on what is causing it. This does seem very specific to something you’re doing on “page_4”, if that might help narrow it down.

Brent

You’ve been a help. I did find a missing sound on that page but that isn’t the problem. And page 4 can’t really be the problem since Corona won’t preview ANY other page. I’ll keep hacking at it.

Page 4 is the only page that Corona would show. The page was also broken, that is, not displaying properly. Yes, I found the solution to the broken page. It was a sound file issue in Kwik. HOWEVER, Corona Simulator is still not previewing any other page, only the one that it has previewed.

I need to publish the entire ebook again and preview it in Simulator and then build it to Android. That would be getting me back to where I was two days ago when the Android build was not working…another, separate issue.

I’m afraid the ball’s back in your court. You’ve been a great help so far, Brent, because I needed someone to ask the right questions. At least we got the page fixed. Now onto being able to actually simulate with the Simulator.

Interesting… so you export the entire book, and it’s supposed to allow navigation to other pages, but it crashes on those pages?

No. Things will be working right again if I can preview a single individual page OTHER THAN the one it is stuck on, page 4. So, for example, I can not publish, from Kwik, page 1 and have it show up in the Simulator. THe simulator is only showing one page, the page 4.

At this time, are there any new errors being reported when you run page 4?

No errors.

This is a cache problem with Corona Simulator, I am sure now. Let me give you an example why I think so…

when I fixed page 4 I was able to preview it in Simulator. BUT if I tried to preview other pages, say page 1, it would still only SHOW page 4.

Now, on page 4 there is navigation, which allowed me to navigate in the Simulator to page 1. So there is page 1 showing in the simulator. Now let’s say I open page 3 in Kwik and preview it. What happens in Simulator? It doesn’t show page 3, it shows the last page that it had shown, page 1.

So, Simulator only shows the LAST page that it previewed.

I could publish the entire ebook to test if it will show in Simulator starting with page 1 but I’m hesitant to do that right now because the publishing process takes over an hour because the book has a lot of images and actions.

I believe there is a caching problem and quiting and reloading does not work, which, by the way, used to work.

Also, when Kwik is done publishing a page to Simulator, it will open Simulator but it will not open the window itself. I am always forced to go to the Open or Open Recent in Simulator.

The question is how do I clear Corona Simulator’s cache or the equivalent?

I hope this makes it clearer.

The only way the Simulator is “caching” a particular state (page) in your book is if Kwik is saving a file (locally) that tells the project to open up to a certain page on reload. Kwik would be doing this… it’s not built into the Simulator, which refreshes as if from a cold start every time your reload the project.

You can explore if it’s creating some file by going to the project sandbox and checking the files within:

File > Show Project Sandbox

This will open up a window with two folders: Documents and tmp. Those represent the “device file directories”, except in this case for the Simulator.

You can just kill that entire folder (delete) it and then re-run to see what happens.

This does not work.

Is your project on a network drive or on a DropBox or similar drive?   I’ve found that when I’m running a project out of one of these non-local drives, Corona SDK can’t see the file changes and it doesn’t know to reload.    I suspect that for local drives, there is probably a “has been updated” flag that gets set that Corona can watch for that may not get set on network drives.

@zentemple. The easiest way to determine if this is a kwik issue or coronas is to run the Hello world sample code we provide.

Run it, and then with it still open modify the code so the text it displays reads “New world”.

If the simulator reloads itself (or you cmd+r) and shows “New World” instead of “Hello world” then the issue is obviously with kwik (which i am pretty sure is the issue)

Please try this and report back

(The files are in a regular folder on my Mac, by the way. AND the page WILL update in the Simulator so no need for the Hello World test. But that’s not the problem…)

I really appreciate the help offered. I think I am not getting across what the problem is clearly so I will reiterate more simply with an example…

Example: I open, in Phototshop/Kwik, any page to preview it, let’s say page 1. I make my changes to page 1 and, still in Kwik, click the Publish button as always. Here is what happens next: Kwik publishes and when done pops ups its usual “Your Project is Published” alert box. Click OK. This triggers and opens the Corona Simulator program but DOES NOT OPEN the Simulator screen itself (and sometimes, not always, I get an error, but not always; see attached).

Next, I have to Open the main.lua file for the project. This is where the ongoing problem occurs: page 1 does NOT preview. Rather, whatever other page I recently previewed shows up.

To recap, I preview page 1 however a different page, that was previously previewed, shows up in the Simulator.

Now, I find that, since there is navigation on the page, I can navigate to page 1 and, lo and behold, there are my changes. And, since the Simulator is now on page 1 because I navigated to it, I can successfully preview any more changes that I make from that point on. Simulator, from this point on, stays on page 1 where I wanted it to be in the first place.

At this point, if I decide to preview a different page than page 1, now the Simulator will only show page 1, not the current page I am working on, and I will have to go through the same thing again.

I hope this is clear.

You really probably need to talk to the folks at Kwik about this.  It sounds to me like there is some file being written out that is holding the current page and when we restart main.lua the kwik code is navigating to the last viewed page for you.

Now for the start up issues, can you have kwik **NOT** start up Corona?  Instead you start Corona and have it pointing to your project folder.  Let kwik just write the update.  Corona since it’s still running should auto reload itself.

If not, from the simulator start screen if you click CMD+R it will reload the last opened project for you so you don’t have to navigate to open the project by hand.

No, I can not NOT have Kwik open Corona.

CMD+R doesn’t work. That was the first thing I tried.

In the Simulator, I open the main.lua file directly and it loads only whatever last page was previewed successfully.