Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
09/26/13 03:47 PM (12 years ago)

Strange Xcode issue, can't figure it out - SOLVED

I have a really odd issue going on with Xcode. If I load my project, and either run in the simulator or on my device, either way, it loads a version of my app from about 2 weeks ago, specifically when loading html files. If I stop it running, and run again, the proper updated one runs this time. It literally alternates every other run... one old, one new, one old, one new, etc, however many times I hit the run button. I know, common issue... simply clean and rebuild. Nope. Tried that. Also tried deleting the cache manually from xcode, resetting content setting in the simulator, and removing everything from the temporary build directories. I also deleted all references to the project in the organizer window. Still does it. Those html files don't even exist anymore. New ones have the same name, but I even removed the reference in the project and readded them. Still does it every other run. Not a big deal when testing, I can hit run, then stop it, then run again... but my concern is when I build the final copy to upload for Apple's review, I have no idea which one it will be... unless I run, get the old version, then stop it, then build for apple and hope for the best I guess, lol. It shouldn't matter, but the old html files were pulled from an online source, and the new ones are local. When it runs the old version, it's still trying to grab the online ones. They have been deleted from my server, but it still loads them... so they have to be in a cache somewhere. Anyone ever run into this? I've never had a clean not work.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
09/26/13 03:54 PM (12 years ago)
That is weird! Did you try restarting Xcode and/or rebooting your machine?
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
09/26/13 03:55 PM (12 years ago)
Yep, both. It's been happening for over a week now. Really strange. Even after I upgraded to Xcode 5.0 a few days ago, it still does it.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
09/26/13 03:57 PM (12 years ago)
Wish I could help. Have you tried stackoverflow.com? I bet somebody has seen this issue there.
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
09/26/13 04:00 PM (12 years ago)
Not yet, but that was going to be my next step. I just know I'll hear "clean the project and delete your cache... if it's not working, you're not doing it right", lol.
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
09/26/13 07:05 PM (12 years ago)
I think I know what may be going on. Depending what plugin you're using for your HTML files, they old ones are probably saved in the cache directory of the app on the device/simulator, and the plugin looks there first. If you're testing on the simulator, try doing a reset content and settings. Also, make sure you hit 'publish changes' on your control panel. You might be using old config data.
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
09/26/13 07:06 PM (12 years ago)
Just saw you did a reset content and settings already. So next thing is to check your config data.
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
09/26/13 07:12 PM (12 years ago)
Cool, thanks for the advice. Yeah tried resetting contents and settings... But I am actually pretty bad at remembering to publish. I'll give that a shot. I know I've done it a few times since it started doing it though. The plugin that seems to be caching is the HTML Pro plugin. Not sure if the custom html /text plugin does it or not, as I didn't have an older version of my pages loaded in any if those. It's somewhere in a cache, because it does it on all versions of the simulator as well as my device. It's just funny that it's an exact pattern of one old, one new, and repeats. You'd think it would be at least randomized, if not all old, if it was cached. I'll let you know tomorrow if re-publishing helps anything.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
09/26/13 08:25 PM (12 years ago)
Are any of these HTML5 pages? although I have the HTML Pro plugin I haven't utilized it yet, but I do know the 'customHTML' plugin keeps pages in the application portion of your BT server, like this: "dataURL":"http://www.mydomain.com/BT-server/files/applications/8847UENF37287/documents/customHTML_JEHFNDK3883.html" So, you may want to crank up your FTP app and see if any of your old custom HTML pages exist there. If so, copy them to somewhere else, unless you feel confident enough to delete them. Just a thought... Cheers! -- Smug
 
farcat
buzztouch Evangelist
Profile
Posts: 1008
Reg: Jan 27, 2012
France
13,230
like
09/27/13 03:46 AM (12 years ago)
I read you clear your cache, have you cleared the Derived Data in your Library? Is that the same as he temporary build directories? Cheers, Farcat
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
09/27/13 06:52 AM (12 years ago)
Thanks for all the input. Still not working. Chris: Published multiple times, then cleaned and rebuilt. Still loaded the old pages every other time. Farcat: Yep, when I deleted the cached build folders, DerivedData was one of them. I removed everything in there. Still loads old files every other time. Smug: Good thought, nd I actually thought that would fix it when I read your post, but no. There were no files for HTML-Pro in there, but lots for customhtml... I thought maybe it would still fix it, so I renamed my documents folder documents2, then made a new empty documents folder and did a chmod 755. Clean and rebuilt.... still loaded the old html files every other time. Really strange. I'm wondering if removing Xcode and reinstalling would get rid of the old files? Upgrading to Xcode 5.0 did not. I'm thinking it won't, because it probably buried deep in a preferences or cache folder somewhere that would be retained if I deleted Xcode. I've even tried running a sweep with CleanMyMac, thinking it would delete any unused caches... but that didn't work either.
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
09/27/13 07:34 AM (12 years ago)
Eureka! Figured it out... one of those stupid little things that were overlooked (of course! lol) Somehow I had saved a copy of two of my html files in the BT_Images folder, so basically when I drug my folders in, not only was I adding my html files from my BT_Docs folder, but also old versions from my BT_Images folder... so the project had two references to the same named html files. Now it makes sense why Xcode was alternating them every other run. Deleted the ones from BT_Images, and all works as it should now :) Gotta love feeling stupid for overlooking the little things after two weeks of not being able to figure it out, haha.
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
09/27/13 07:47 AM (12 years ago)
If I had only had a dollar for each hour I've wasted on something like that over the last year... (Well, $1/hr doesn't seem like much, but you get the point)!
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.