Spritebuilder, XCode 5.1 and Device Build Errors - ios

I just updated my Cocos2D to the newest version. I am using xcode 5.1 and am also using Spritebuilder. After updating my xcode I have been having a slew of errors and problems with my application. It's quite frustrating, because before I updated, I wasn't having any issues whatsoever.
I currently am testing my app on the iPhone 5S and iPhone 4S. It builds and runs on the 5S fine, but it has some UI issues, such as the titles of some of my buttons not showing up, and some CCLabels not appearing.
When I try to build and run on the iPhone 4S, I get this huge error, that I can't make any sense of:
file '/Users/Mikey/Desktop/MissileMadness.spritebuilder/Source/libs/cocos2d-iphone/cocos2d- ui/CCBReader/CCBLocalizationManager.h' has been modified since the precompiled header '/Users/Mikey/Library/Developer/Xcode/DerivedData/MissileMadness-erzxydvceuwigkcfbtejuhnghdcf/Build/Intermediates/PrecompiledHeaders/Prefix-cgfsucpxydgzhugfgfecjbxgjlks/Prefix.pch.pch' was built
Has anyone ever encountered this? I going crazy because I'm about done with my app and wanted to submit it soon.

it seems like you have an error with a .pch file.
PCH files can dramatically speed up your build process because they are built and cached.
They are not very effective if you change the headers that are included in these things. Usually you would only put headers that do not change.
When updating Cocos for example, XCode may want to use the cached file, which is no longer correct so perform a Project->Clean and then delete your Derived data folder as outiled in the answer of the question below.
Can I safely delete contents of Xcode Derived data folder?

Related

What is the simplest way to copy project folder to new Mac with updated IOS and Xcode?

I recently acquired a newer MacBook to run the most recent iOS and Xcode versions. I copied a project folder to the new Mac and opened it with Xcode 11.4 (was 10.1 on old Mac). I get 14 errors all related to "Failed to render and update auto layout status for ..VeiwController". The simulator runs fine, but the main storyboard doesn't render the button icons properly. I can add new constraints to the buttons to show them properly but the errors don't go away. I assume I have lost some info/files related to autolayout when I copied folders. I have read about similar issues. Most talk about using Github or some other 3rd party for maintaining files. Is there any other way to get this done? It seems like updates computers/software should be simpler.
Since reporting this, I have used the same process of copying folders of all other projects and have had no problems. But one project, the largest and most complex continues to have 14 rendering errors and always the displayed err message "An internal error occurred. Editing functionality may be limited." The strange thing is going in and out of viewing Main.storyboard several times gets rid of the errors eventually. Unfortunately, the errors always come back when I open the project. And sometimes they go away, then come back randomly in the same session.
So the answer to "whats the simplest way to copy a project folder to new computer is just that - Copy the project folder! But thats the wrong question for this problem.

Xcode 8.3 Indexing & Building Extremely Slow

I am posting this after reading many similar posts on here regarding this issue and none of the solutions that worked for other people not working...
Xcode Version 8.3.3 (8E3004b)
Swift 3.1
Things I tried
Deleting Derived Data folder
Deleting Workspace File
Cleaning Build Folder
Cleaning Build
Reinstalled Xcode (after complete removal)
I also looked for Swift Issues:
Removed all concatenating strings
Cleaned up Swift arrays and dictionaries
Added Whole module optimizations
This all started happening after last Xcode update of 8.3.3. My project was compiling within seconds and now I have to wait at least 15 mins for it to index, then 5 minutes to compile after everything I change even something small in code.
When Building, it get stuck in "Compiling Swift source files". Is there way for me to look in to where it is actually getting stuck?
BIG UPDATE
I tried pretty much everything. Read every article, post, ect. NOTHING worked. My project was created right after 10.0.
Solution
Creating a new project and copying each file worked! It used to take 8-9 minuted to build. Now less than 2 seconds!
Apple knows about this problem, and says that Xcode 9 beta will perform much better. Note that if you don't want to update to Swift 4, you can continue compiling in Swift 3 mode using Xcode 9. The big limitation is that you won't be able to submit your project to the App Store until Xcode 9 goes final.
Also, Xcode 9 contains a new build system. You don't get it by default: you have to turn it on for this project. Choose File > Project Settings and switch the pop-up menu to New Build System (Preview). This is experimental, but it will be the default build system eventually, so it would be interesting to know whether this makes an appreciable difference.
If you don't want to update to Xcode 9 beta, you will just have to do a binary search: comment out all your code and start adding it back, piece by piece, until you find that piece that's causing the trouble.
The best way to work this out is to find what out what the build is doing while compiling your code. This is a really useful tool to use: https://github.com/RobertGummesson/BuildTimeAnalyzer-for-Xcode
When you run this tool it will show you what methods are taking the longest to compile, and then you fix those. Once you have done that, you can also try the answer I gave here to decrease the build times: Extremely long compilation times with Swift in Xcode

Air ios imported swf (no code) suddenly starts giving 'Uncompiled AS' error

I'm building an iOS app with FlashBuilder 4.7 and Air SDK 25.0. The app has code which installs fonts via an external SWF imported at runtime (no code in external SWF, just fonts). Imported file has been working for months but now throws below error in debugger on device :
'Uncompiled ActionsScript'
I have gone back through previous builds and some that had been working fine suddenly throw error on the swf file. Other old builds will work importing the same swf, but after running a build which fails, the working one will start throwing error!
Anyone else struck a problem like this?
I recently upgraded from SDK 22 to 25, but the problem appeared some time after that. Only significant change was running a dodgy zip ANE that crashed the debug. I've removed the ANE, but I suspect something may have been corrupted somewhere.
I've tried resetting FlashBuilder settings by deleting .metadata folder in workspace.
Tried Cleaning the projects, tried duplicating projects, tried re-publishing the swf to import.
Can't work out why some builds don't work and others do, but then stop working with no changes to the project. I feel sure there is a fix that will suddenly make all of the builds work again...
Any suggestions anyone?
I found my problem.
It appears I have previously been using only the 'Fast' packaging method to test app on ios device, which works.
When set to 'Standard' (Build) packaging to test on device it causes the swf (with embedded fonts) imported at runtime as having 'uncompiled actionscript'.
This answers my original query, but if anyone has a work-around, or alternate method of importing fonts at runtime, I'd be very happy to hear!

Error Loading Image Files on iOS with Latest Corona SDK Build

As of yesterday, image files were being pulled from the image folder correctly to build character models, but now most of the calls to display.newImageRect result in a black rectangle. This glitch only occurs on iOS, not in Android or the Simulator. Any suggestions?
There have been no changes to the code involved with loading images.
Corona: v2014.2393
OSX: 10.9.5
XCode: 6.1
There are no messages in the console that would indicate being unable to load the images or anything of that nature, and the issue is that it works in the simulator, and on Android. However, when the application is built for iOS, the error occurs when building character models and loading most of the images, but, curiously, using the exact same module in another scene (a far less complicated scene) works still. Texture memory used stands around 15MB. I don't know, if that might be the cause of the error, but I'm fairly certain that it isn't. As I said, the curious thing is that a build from 2 days ago still works and loads the images just fine.
For clarity, all image files are PNGs.
UPDATE: The same bug occurs on earlier builds that previously functioned. So, this might be an issue with iOS or, at least, our app's compatibility with the latest version of iOS 8.
Using an older version of XCode and Corona seems to work only when building the older version of the application. Furthermore, purposely misspelling file names results in a different error. So, it's not that the images are not being found. Using the same image files in a working build on another machine doesn't produce the glitch either. Nor does transferring copying the modules for image loading over to the older build.
I'm seriously baffled.
If you can reliably reproduce this issue, I suggest you ask on Corona forums or report a bug with them.

Add large database file to iOS App bundle at compile time to avoid indexing?

I'm having a severe problem using the new versions of Xcode (4.4 & 4.5) in that, my project has a very large .sql database file stored in the project. This file cannot change, for many reasons... but it is +270Mb in size. This causes Xcode to hang on 'Indexing File...' and becomes completely slow and unresponsive to the point that I have to force quit the app, and cannot actually get any coding done. I have raised a bug report with Apple several times, but it is seemingly being ignored!
I do not want to disable Xcode indexing entirely as i find the code completion features incredibly useful.
My question is: Can i remove the database from the Xcode bundle resources, and then add it automatically at compile time?
Would appreciate any and all advice on how I could get round this problem.
Regards,
Sam
Incase anyone comes across this problem of Xcode indexing a huge unwanted file... I fixed it by setting the file type in Xcode to an 'MP3 Audio file'...
Doesn't seem to have any effect on the function of the .sql file once it's in the App, but stops Xcode trying to index it.
If anyone has a better solution for this, i'd love to hear it!

Resources