cocos2d xcode frameworks are not being added to the project - xcode

I have recently updated to Xcode 6.0.1. I am trying to create an Cocos2d 3.x project. When I do I get 200+ errors. The errors are due to the fact that the frameworks are not automatically being added to the project. I can go through and add them manually and fix the problem but this gets very annoying to repeat every time I want to create a new project. Can anyone tell me why the frameworks aren't being added? It used to work. I'm pretty sure the problem started when I updated to Xcode 6.0.1. Thanks.

I found the answer here: http://forum.cocos2d-swift.org/t/something-wrong-with-the-xcode6/15437
Basically, the problem is in Xcode 6.0.1. They recommend creating the project in Xcode 5 or SpriteBuilder and then opening it in Xcode 6.

Related

Unable to do refactoring on my Swift file in Xcode 9

I am using Xcode 9 and I am trying to do Refactoring on my Swift based file but every time I am getting below error:
Refactoring engine ranges didn't match initial ranges
Why isn't it matching the initial range?
Workaround: Restart Xcode.
This has not been resolved yet as of January 2018 (Xcode 9.2).
Build your project (Command ⌘ + B) and it will fix the error. After doing it, I could rename my file successfully.
I have Xcode's project created using Xcode8 long time ago. For some reason I have to upgrade to Xcode9 (9.4.1 exactly). Then I experienced that error only on that old project, not the new one created using Xcode9.
So i think that error related to project issue. So I decided to compare the settings between old and new one. There are some differences, and after several tries, by changing Optimization Level for Debug solved refactor issue.
In project editor, select your Target, Build Settings
Set Optimization Level (Debug) = No optimization [-Onone]
Delete DerivedData folder related to your project in /Users/YourMacUsername/Library/Developer/Xcode/DerivedData
Clean project shiftcommandk.
Build project commandb.
Update For some reason, it's not happening for me anymore. I noticed also whenever I don't let indexing finishes before trying to start doing a refactor or tap on refactor many times, still see the error, but not permanent anymore.
I asked an engineer at WWDC 2018 about this issue. This issue was happening for me in only one project in my workspace. Other projects in the same workspace works fine. At the moment, there's no solution to this issue. If you want to help Apple to fix this, you can close your Xcode and run following command in terminal:
SOURCEKIT_SERVICE_LOG=3 /Applications/Xcode.app/Contents/MacOS/Xcode 2>&1 | tee /tmp/sk-log.txt
And then try to reproduce the issue and send them the log file (/tmp/sk-log.txt) so they can narrow it down and hopefully fix it in future Xcode versions.
Notice This is project related issue and won't be fixed with OS updates, Xcode updates, or any number of restarting applications, at least the one that I'm having.
I have the same issue in Xcode 10.3.
Refactoring didn't work when I right clicked → refactor → rename on the class name in the class definition. However it did work when I did the same somewhere in code where I use that class.
Product -> Clean Build Folder -> Quit Xcode -> Reopen Project -> Build
I update to Xcode 10 and finally refactoring now it works again after a year without refactoring
I am on Mac M1 and using Xcode Version 12.5 beta 3.
I was facing the same issue when trying to rename ViewController.
Before renaming it, I moved it to a new group, and my code was in a running state. Not sure if that was the reason for the issue.
But I restarted the Xcode and the issue was resolved for me.
I was experiencing the exact same issue. It turned out that I had my build configuration set to Release mode. Changing it to Debug, cleaning build folder and recompiling fixed the issue for me.
Remove DerivedData
This worked for me for this error and other kind of refactoring errors.
Close Xcode
Remove DerivedData:
rm -rf ~/Library/Developer/Xcode/DerivedData
I experienced this on a Mac M1, using Xcode Version 14.1 (14B47b).
This helped:
Clean project: shift-command-k.
Build project: command-b.

Error in conversion to swift 3 syntax for an existing cocoapods integrated project

I've recently upgraded to xcode 8 and did a conversion for my xcode project. While every other swift files checks out fine, there seems to be issues with this particular swift file.
I suspect it could be a result of cocoapods not being updated and thus I did a repo update to the latest pre version before doing a pod install on the project again but still to no avail.
Hmmm ok I found a way to fix this, apparently just going to product>clean will solve most of the problems. This is for anyone out there converting to swift 3. Now on to solve some other problems...

How to update Kobold2D 2.1 project to MacOS10.10 / XCode 6.1?

we've got a major project written in Kobold2D by Steffen Itterheim, (which is itself a wrapper for Cocos 2.1), and since upgrading to XCode 6.1/OS X 10.10, the new iOS 8 framework seems to render many parts of the Kobold-library and the Cocos implementation unusable, or it seems to need a rewrite.
Has anyone updated a Kobold2D project successfully to iOS8 yet?
Are there simple ways to upgrade it, or is it necessary to rewrite the entire library?
If there are no simple ways to upgrade, has anyone migrated a project from Kobold to cocos 3 yet?
Any hints would be much appreciated!
Averett
PS. I have seen this question: How to convert Kobold2D into a new Cocos2D 3.x project? - but the answer is not very helpful, as this solution would omit iOS 8.
We actually have created a script to make the necessary changes to Kobold2D. You can find it in this post:
https://www.makegameswith.us/gamernews/406/xcode-6-fixes-for-kobold2d
Basically all you need to do is run
curl https://s3.amazonaws.com/mgwu-misc/xcode6_kobold_patch.sh | sh
in the terminal, when you are in the root folder of your project.
I have just compiled my Kobold2D 2.1 project using XCode 6.0.1. It breaks initially at several lines, but it's easy to fix. I only found a couple of errors:
Multiple methods named 'setPosition:' found
Example:
[_target setPosition: newPos];
Fix: cast the object to CCNode
[(CCNode*)_target setPosition: newPos];
Do this for all errors found
You also need to import "ccNode.h" at the top of the file.
Use of undeclared identifier 'MPMovieControlModeHidden'
I found that the #ifdef__ #endif enclosing the offending line was commented out. Uncomment them to fix the problem.

xcode 4.5.2 upgrade issue

With previous version of xcode works perfectly for my cocos2d and box2d project
but today i upgrad it(to xcode 4.5.2) because my iphone device was having os version issue.
and then all of my upgrade progress finished
i have some trouble with in it
when i run the project in new xcode, it started complain me that i have no Default.png
but i'am already have defalult.png in my project
so why this happening ? and how can i figure it out...
i've already clean and rebuild
and also delete default.png and recopy from original arsenal
but same problem occurred
(as you guess .. i'm not good at explain my opinion in english.. sorry for that.. )
I expect you mean this:
Missing - "Default-568h#2x.png" launch image"
That is the startup image for the iPhone 5 screen. If you click on the warning it will create one for you.

How to set up SDL on XCODE 4?

I'm having troubles with sample templates and overall installing of SDL on my Xcode 4.
There are no tutorials and old templates just don't work!
If anybody has Xcode 4 SDL templates, please share.
EDIT:
#Joshua Nozzi I tried opening template from old version of XCODE, 3.2 and it opened, but there were no files in the project and it said - base sdk missing. I tried adding SDL.framework but it didn't help!
I just pushed my working SDL test Xcode project as a public Github repository, so feel free to see if it works for you: https://github.com/Ricket/HelloSDL

Resources