Why am I unable to run this iOS example project in Xcode? - xcode

https://github.com/rs/SDWebImage
That library includes an example. When I open the example project, "Run" is greyed out under the Product menu. If I switch the scheme to the last one, it crashes with a clang error.
I'm running the Xcode 5.1 DP1, is that why?

You need to git clone the project with its submodule: git clone --recursive…
Do not use the "download source code" feature of Github as it doesn't retrieve project dependencies for you. You may also disable WebP by linking the demo project with "SDWebImage" target instead of "SDWebImage+WebP".

Related

Flutter library not found for -ldevice_info, can't archive the ios app with xcode

when I try to archive the app or run in a real device, I always get below errors:
ld: library not found for -ldevice_info
clang: error: linker command failed with exit code 1 (use -v to see invocation)
but if I just run in a simulator, everything is ok, if I try to remove the device_info package, then it will also show another package not found:(
I am using the latest flutter dev sdk, and I have setup a valid iOS developer certificates.
Thanks!
It seems that the solution here in this SO post as mentioned in the comment works for this case:
In new projects, in the iOS part is necessary to adjust a few
parameters, such as signing, and that you can only do in Xcode.
So, try to open the iOS project with Xcode and try to build it from
there. You'll see better warning and error messages there, specially
regarding signing.
You can open Xcode and locate your project ios folder, or:
cd yourproject/ios
open -a Xcode .
Then select Product > Run in the menu.
Also, this GitHub post discussion could also be a possible reason for other cases. Try to check the following:
I was able to successfully archive with your pubspec.yaml.
Can you confirm you opened ios/Runner.xcworkspace and NOT ios/Runner.xcodeproj? See Better handle case where a developer
opens Runner.xcodeproj instead of Runner.xcworkspace
#10770.
Did you run flutter build ios before you Archived? See https://flutter.dev/docs/deployment/ios#create-a-build-archive.

Adding square SDK as dependency in Swift 4, Xcode 9

I am looking for help doing this step in Xcode 9, Swift 4:
Git Submodules
Checkout the submodule with git submodule add https://github.com/square/SquarePointOfSaleSDK-iOS.git, drag SquarePointOfSaleSDK.xcodeproj to your project, and add SquarePointOfSaleSDK as a build dependency.
I simply have no idea how to do this - and the examples I found have not worked.
Any help would be greatly appreciated as I am dead in the water.
Thanks, Craig
You need a git repo in order to run that command. By default, Xcode will create a git repo for you in your project, so you can simply open your terminal, navigate to your project directory and run:
git submodule add https://github.com/square/SquarePointOfSaleSDK-iOS.git
This will copy "SquarePointOfSaleSDK-iOS" to your directory. Then, in Finder, you can simply open "SquarePointOfSaleSDK-iOS", drag "SquarePointOfSaleSDK.xcodeproj" to above your project in Xcode. It will ask if you want to save as a Workspace, you should say yes. Then, in Xcode, click on the root of your project, and under "General" - "Linked Frameworks and Libraries", hit the "+" and choose "SquarePointOfSaleSDK.framework".
After that, go ahead and do a build to make sure everything is working, and then you should have access to the SDK within your project.

Adding Files and Select Multiple Targets in Xcode

I have over 200 projects in my XCode and when I add a new file or class I have to select each target one by one to add it to it. Is there a way to select multiple targets instead?
Try the awesome AllTargets Xcode plug-in by poboke available on Github (works with Xcode 5+).
Manual build and install
Download source code and open AllTargets.xcodeproj with Xcode.
Select "Edit Scheme" and set "Build Configuration" as "Release"
Build it. It automatically installs the plugin into the correct directory.
Restart Xcode. (Make sure that the Xcode process is terminated entirely)
Manual uninstall
Delete the following directory:
$HOME/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/AllTargets.xcplugin
↳ Tutorial on how the plugin was created (Chinese).

SpriteBuilder - how to update Cocos2d

It has been awhile since I have used SpriteBuilder with Cocos2d. I am trying to create a new project from SpriteBuilder that I can modify in Xcode. From SpriteBuilder I go to 'File > Open Project in Xcode". This opens Xcode with the new project. When I build the project I get over 40 errors (e.g. 'UIAccelerometer' is deprecated: first deprecated in iOS 5.0 - UIAccelerometer has been replaced by the CoreMotion framework.). It looks like I need to update my Cocos2d. So I went to the repo here and found this statement in the README: "SpriteBuilder also allows you to update the Cocos2D version in your project, to newest version, making it trivial to always keep you project updated to latest Cocos2D version." So it looks like it should be easy to do it, but I can't figure it out. Any ideas?
Xcode Version: 7.1 (7B91b)
SpriteBuilder Version: 1.4.9
SpriteBuilder Revision: eea568a5c7
I'm not sure how you can update cocos2d directly from Spritebuilder, but rather than rely on SpriteBuilder to perform the update, you can do it manually.
You can get the most up to date version of cocos2d by downloading the project straight from its repository on Github. If you want to clone the repository from the command line, the command is:
git clone --recursive https://github.com/cocos2d/cocos2d-objc.git
This will download the latest version of Cocos2D (and its dependencies). Now to update the project. Navigate to the new version and copy three folders: cocos2d, cocos2d-ui and external. These three folders contain the changes that need to be moved into your project.
The next part is finding the location of Cocos2D in your project—it's located in the folder named cocos2d-iphone inside the project. Pasting the new folders will prompt a warning that you are trying to replace folders that exist already. For the current updated version of cocos2d, this shouldn't be a problem.
Then, you'll want to "Clean" your project and set your iOS Deployment Target to 8.0.
As a safety precaution, you should then clean the project build folder. You can find the "Clean Build Folder..." by holding the option key (⌥) while selecting the "Product" drop down. (Note that this is different from just using "Clean".)

How can I checkout github project on xCode 5 correctly?

How can I checkout github project on xCode 5 correctly?
I have done checkout from xCode (Source Control - Check Out...). But now I can't commit any changes to the repository (Source Control - Commit...). All "Source Control" commands are disabled on the xCode except "Check Out...". But ".git" folder presents on the project's folder. What's wrong with it?
You can follow this tutorial, which describes your case after having created locally a git repo and done some commits:
The git repository is ready, but if you go back to Xcode and open the Source Control menu, you’ll find out that everything is still disabled.
That’s because Xcode doesn’t get notified automatically about our manual git repository addition.
So, close Xcode using the menu Xcode > Quit Xcode and re-open it.
Now, in the NoGitExample project if you open the Source Control menu once again, you’ll see that all options have been enabled, just like if we would have added the git repository along with the project creation.

Resources