Difficulties adding ShareKit to project - iphone

Okay, so I seem to be having a bit of difficulty in adding ShareKit to my project.
I've downloaded the latest version via Git. I'm dragging and dropping the 'ShareKit' folder from Finder because you can't do it drag and drop from the xcode project.
I've figured out how to ignore ARC by setting ShareKit files to -fno-objc-arc in my Target > Build Phases> Compile Sources. So that gets rid of my arc warnings.
However, how do I get my "Submodules" folder to come along too? In the ShareKit project it doesn't appear in the xcode folder hierarchy, but it is in the project folder and you can access it through Finder. Sharekit's demo project compiles fine.
So without Submodules, I get errors like "SSKeyChain.h not found" (https://github.com/ShareKit/ShareKit/issues/191) among others. So I drag and drop the entire Submodules folder into my project, and that solves some, but creates others. The Submodules folder is very convoluted and I'll see errors referring to lines trying to import Cocoa/Cocoa.h, which is for mac and not iOS I believe. Some of the Submodules files are looking for files like "SampleAPIKey.h" and if they're not there, hell if I know why they aren't.
Has anyone had experience with figuring out how to do this?

Note: Wednesday, September 19, 2012
In a project that I use ShareKit, after building in Xcode 4.5, in I was getting a number of warnings and additionally a fatal error when trying to build for the iOS 6 Simulator. After having problems updating the ShareKit code via the instructions in the ShareKit github FAQ I decided to remove and then read SK to my project from scratch. The new install instructions that on github are greatly revised and following step by step worked without a hitch, so the work around that I previously provided is most likely out of date.
End of note Wednesday, September 19, 2012
I had some difficulty doing this myself but did get it working. Assuming that you are using Xcode 4.x make sure that you follow the directions in Step 2 of the install instructions re that version, but it took a number of tries as the instructions were not perfectly clear to me.
What worked for me was to 1) drag the Submodules/ShareKit.xcodeproj file from the Finder to the project I was adding SK to at the bottom of the tree navigator UNDER the other groups and NOT adding it as if it was an additional project necessitating creating a workspace, 2) then, I dragged the Classes/ShareKit folder from the tree under the newly dragged ShareKit.xcodeproject into the main project tree and when prompted choose "Create folder references for any added folders", and finally 3) delete the ShareKit.xcodeproject and click "Remove Reference Only".
Hope this helps.

Related

Xcode 13.1 bug editing dependency as local

Just upgraded to Xcode 13.1 and opened a SPM project by clicking the Package.swift file that has some dependencies.
In the former versions I could simply edit one of these dependencies by dragging a local clone of the package into the Project Navigator.
Xcode was then going to ignore the checked out dependency and let me edit the local one.
Apple documents this here.
When trying this with Xcode 13.1, Xcode just copies the folder into the project folder, like it does with normal files/folders that are not SPM projects.
Did I find a bug or missed I something?
Thanks!
Update: I found out how to work around by creating a .xcodeproj file with swift package generate-xcodeproj. There I could drag in the package as always. This works but is not the way to go, as the xcodeproj generation is deprecated by apple.
It looks like there is now an Add Local... button at the bottom of the add package wizard. Selecting the package from your local filesystem yields the same result as the "drag from finder" instructions you've linked.
The wizard is accessible from:
File > Add Packages, or
Project.xcodeproj > Package Dependencies > +.
I was having this problem, too, but after seeing the first comment on the other answer, I tried this:
I used File->Add Packages->Add Local…->navigate to local clone of dependency->Copy Package, which indeed seems to do nothing, but it puts a .package dependency line onto the clipboard.
I then edited my main project’s Package.swift to replace the existing Github dependency with the contents of the clipboard. Now I can edit the dependency’s files directly in the “Package Dependencies” portion of the project contents pane (which I wish you could do for a regular Xcode project too).
This solution kinda sucks, because it forces me to modify Package.swift, which means everyone on the team has to set things up the same way. Fortunately, I'm the only one working on this project, but future me is sure to be bitten by this.

Sparkle 10.9 Linking Error

Having an issue where when trying to add Sparkle to my project with Xcode 5 running 10.9.
I have followed the tutorial to a T, but when I get to the point where I need to copy the framework and set its copy location that is where there seems to be no way to set the copy destination in the copy bundle resources section and it just puts the framework int the /Resources folder.
I have ready through this tread thoroughly and have tried all the suggestions here.
http://www.lists.apple.com/archives/xcode-users/2012/Aug/msg00249.html
I recompiled Sparkle from the latest source and set the Installation Directory to #executable_path/../Frameworks from #loader_path/../Frameworks I get the following error.
dyld: Library not loaded: #executable_path/../Frameworks/Sparkle.framework/
when I revert and try to re add the framework I get this error.
dyld: Library not loaded: #loader_path/../Frameworks/Sparkle.framework/
If I remove the framework from the link framework from binaries altogether and just focus on the Copy Bundle Resources then I get this error.
Unknown class 'SUUpdater', using 'NSObject' instead.
The tutorial is written for Xcode 4 I know. One step says to use Copy File Location but that seems to be gone in Xcode 5 any help is appreciated.
UPDATE
I found a work around but its very messy.
Add the framework to the "Add files to build" build step.
Unlink the sparkle framework.
Open Derived Data folder and then open the App Build, then browse to Resources. Move the sparkle.framework folder to the root of the app and place the framework into a folder named Framework in the root level of the app.
Remove the framework from the "Add files to build" step.
Re-Link the framework.
Rebuild the App and voila it works.
Basically your adding the framework in a Framework folder manually and then linking it up at the end. What makes it messy is that the build changes occasionally in the Derived Data folder.
I have the same problem. And I think I have solved it.
It happens because the Sparkle.framework isn't copied to Frameworks folder(where it should be), it is copied to Resources folder when you build the application. To solved it:
Download the source of Sparkle from GIT (https://github.com/sparkle-project/Sparkle) and open the project in Xcode 5;
Go to Build Settings of every targets, then find Base SDK, change the value to macosx.
Go to Sparkle.framework's Build Settings. Find Installation Directory, Change its value from #loader_path/../Frameworks to #loader_path/../Resources under Sparkle.framework's Build Settings.
Build.
Copy Sparkle.framework under Products group in Project Navigator to your project.
Say YES and take a self highfive.
I was suffering from the same problem, then I found this:
http://www.lantean.co/sparkle-in-sandbox-mode/
The key is to add the Sparkle.framework to the Frameworks folder using the "Copy Files" section from "Build Phases".

Could not create bundle folder for versioned model?

I received project from other developer. Then i opened iOS project in Xcode and build it, i got error as below:
Volumes/Macintosh D/My workspace/HCProject/Model/HealthCareModel.xcdatamodeld:0: error:
Could not create bundle folder for versioned model at
'/Users/TomMac/Library/Developer/Xcode/DerivedData/HCProject-bdxarurbgcdbaecxaoocaroetsjt/Build/Products/Debug-iphoneos/HCProject.app/HealthCareModel.momd'
Sorry if this is a basic question,please help me out.
Thanks a lot.
I don't know what causes this but I have experienced this error before.
The simplest way to fix it for me was to delete everything in in the "/Users/TomMac/Library/Developer/Xcode/DerivedData" directory.
There will be multiple directories under here you can probably get away with just deleting the one for the particular project that failed, but I haven't tested this.
I had this same problem after a large Git merge. It turned out I had a duplicate .xcdatamodeld in my Compile Sources. I deleted one and haven't had the problem since.
In case you're not sure where to look, open your project in Xcode and click the project name to view it's properties. Go to the 'Build Phases' tab, then expand the 'Compile Sources' heading.
iOS simulator, Select "iOS Simulator"
Select "Reset Content and Settings"
I had this and I thought I'd got rid of it but it kept coming back every few builds. I now seem to have permanently got rid of it with the following steps:-
Locate the model file in Finder and take a copy of it to another (safe) location.
In Xcode, delete the file from the project (selecting move to trash).
Build the project just to make sure the project file is saved.
Close Xcode.
Locate the derived data directory in Finder and delete everything. (I actually deleted the entire DerivedData directory just to be sure).
Re-open XCode.
Copy the model file back from your safe location to your project directory location.
Drag it into the Xcode project navigator in order to put it back in the project.
Build - it should now work...
I had same issue and got it resolved by deleting content of derived data.
Below is step for the same :
1. Press cmd + comma (,) shortcut key to open preference window of Xcode.
Or Goto Xcode menu on top and select Preference
2. Select Locations tab present in last
3. You can see Derived Data under Locations section
4. Click on small arrow present next to path. This open directory where project’s derived data content is present.
5. Select your project and delete it. Also delete the module cache folder.
Note : You can even delete all content of Derived Data folder.
The content of this folder is generated again when it run. It is like cache.
6. Quit your project
7. Open your project.
8. Clean your project (cmd+shift+k)
9. Build your project. This should build your project with no issues.
I had the same problem this morning. After multiple cleans, Xcode restarts, and finally a system restart, I looked in the system log. I found this error message that corresponded to the time of the build error.
"Interface Builder Cocoa Touch Tool[89487]: BUG in libdispatch client: kevent[EVFILT_VNODE] add: "Bad file descriptor" - 0x9"
I changed permissions on Library/Developer/ folder and granted read/write privileges to "everyone", then restarted Xcode. The build was successful.
I don't know for certain that the build error was caused by a permissions problem but it's worth a try. (If you have a lot of projects in the Developer folder, the permissions change can take several minutes to complete.)
In my case it was a duplicate version of the data model. Right click on the .xcdatamodel file in your project explorer and select "Show in Finder". Check for duplicates and delete them.
In my case I had to follow two steps to get this entirely fixed:
Delete the problematic version's hidden files. Note that FILENAME.xcdatamodeld is a folder and if you browse it you'll see the different versions you have there. The one that gave me the error was still there so I first had to look for hidden files and then delete it.
Clean Xcode's DerivedData folder as suggested by others here.
Hope this helps folks.
In my case my testsFileName.xctest (in workspace > Products > testsFileName.xctest) somehow has the application target as his target membership.

three20 build issues

I am having issues with building my project with three20. I previously had three20 folder outside of my project folder, then I decided to clone another three20 inside my folder and then re-run the script again. However now when I tried to do import "Three20/Three20.h" it constantly says there's no such file or directory. What should I do here?
This may have changed, but I recall with my last Three20/xcode4 experience that you have to change the build directory settings for xcode4 for it work.
In Xcode preferences, go to the locations tab and change the dropdown for build location to "...locations specified by targets"
As I understand it Three20 expects the build directory to be in the same place it was using Xcode3. No promises, but give it a try.

linking gdata to an xcode 4 project

I'm having major issues linking gdata to a project after upgrading from xcode 3.2.5 to xcode 4. I would like to know if anyone is having similar issues, and what did they do to resolve them. i am using gdata version 1.11 which is the latest on their site. The project works flawlessly on 3.2.5, thanks.
I have created a workspace for my project, and then added the gdata.proj to it. So I do have all the files linked by reference. But project files which include #import "GDataYouTube.h" do not see the file. I get "No Such File or Directory"
Good News... resolved and tested, all working follow these steps...
Open your project in xcode 4 from 3.2
click File -> Save As Workspace
in project navigator on the left, collapse your Project if you see all the files
below your collapsed project, in the empty space right click or control click -> Add Files to...
select the project file you wish to link to, leave Copy items unchecked, click Add
Now you will see 2 collapsed projects in your Project navigator, expand both
Now what I didn't know I had to still do
Drag the files or folders you want from the second project to your main, make sure your Main project target is selected in the options, and I also have group selected then click Finish
You are good to go, you might have some warnings about your second project and its targeted SDK. Fix those by clicking the project name in the Project Navigator -> Build Settings -> Base SDK to 10.6, Deployment Target to 10.5