Xcode 6.1 Link Binary with Libraries; Framework not showing up - ios

I'm having issues getting a framework to work when checking out my project from a repository. If I check out the project I get a build error:
'Module SQLite not found'.
I went into Build Phases and checked that everything was properly set. I tried deleting the entry under Link Binary with Libraries and then re-adding it. This is where the issue occurs. When I go to add the framework, again, it doesn't show up.
For other parts of the Build Phase: Target Dependencies and Copy Files I can delete the entries and re add them and the framework still shows up no problem.
Unfortunately, I don't have enough reputation to post photos but the links to the Xcode screenshots can be found here: http://imgur.com/a/OfWLm
I'm assuming it's a configuration error because all of the required files are in the repository as well as the checkout folder. So if anyone could assist me in figuring out what needs to be changed, that would be greatly appreciated.
Note I'm using Xcode 6.1 and the framework in question is SQLite.swift found here.

Related

Custom Module not found

I'm a beginner in iOS development. I cloned a repo containing working code. I opened up the project in xcode, but when I build the project I receive the error Module 'Subscriptions' not found.
In my build settings, the Subscriptions.framework framework is in Linked Frameworks and Libraries. From what I've researched about module not found errors in xcode, this should be the fix for my problem. However, this is not fixing my problem. This project should normally be able to be built and compiled. Is there something I'm missing here?
Update
Here is the xcode file tree view.
Main
|-Main
|-MainTests
|-Products
|-Frameworks
|-Subscriptions.xcodeproj
|-Subscriptions
|-Products
|-Subscriptions.framework
|-Frameworks
|-Pods
Pods
Ok. I finally figured out what was going on. I dove into the directory I thought that the Susbcriptions.framework was being installed in, and it wasn't there. The directory in the build products path was set to Products/Debug-iphoneos but the Subscriptions.framework was instead being installed into Products/Debug. This made me realize that somewhere in XCode I had the build setting set to build for MacOS instead of iOS. I found the setting and rebuilt my project for an iPhone XS simulator and the module was imported successfully.

Build error Xcode 10 - Multiple commands produce

I just upgraded to Xcode 10, and I suddenly face this error when I try to build, any ideas how to fix it? I tried cleaning derived data, but without any luck.
If you use CocoaPods, click Xcode menu file -> Workspace Settings , And click Build system choice Legacy Build System
If you not use CocoaPods, same of top , select Project Settings
If your app is generating the error related to the multiple .app files just like mentioned above in question then removing the .plist files from "Copy bundle Resources" WILL NOT WORK.
If the error is related to .app file then follow the following steps.
Select the Target.
Go to Build Phases tab.
Remove the items listed in Output Files
Compile the code if it compiles successfully then not follow the next steps.
If code does not compile successfully and Xcode may give you an error related to "Library not found". Then add the missing library in General Tab in Linked Frameworks and Libraries that Xcode mentioned in the error.
Keep adding these libraries (that Xcode ask through compile errors) in Linked Frameworks and Libraries until the code compiles successfully.
Hope this helps.
You can try to change the build system to Legacy,
File > Workspace Settings > Build System > Legacy Build System.
I also faced this issue in xcode 10 but it was because of adding the same framework in main project + other extensions (watchkit or siri extension etc).
I added ObjectMapper in podfile for my main project + for my extensions. When I compiled it gave me an error that multiple command produce and also shows me which framework is causing this issue. Now its working fine for me as I've removed it from my extensions I wasn't using it in my extensions.
Don't know about your issue may be you can check your podfile.
If this is CoreData related. The issue is that you are trying to generate the NSManagedObject subclass but you need to set the 'CodeGen' option to Manual/None. This option is defaulted to Class definition and this would regenerate the code thus creating this issue.
i encountered this issue as well while working with CoreData.
in my .xcdatamodeld file, it came down to the fact that, during the creation of my various Entities, i had copy and pasted one multiple times (thinking i was saving time because various properties were similar enough that i thought this was a good idea).
the resulting Build error Xcode 10 - 'Multiple commands produce' occurred because i forgot to check and make sure the new Entities were set to their own unique corresponding class to match the new Entity in the Data Model Inspector pane.
unfortunately, it took me two days to figure out the original Entity's Class Name was still in place.
so lesson: careful when you copy/paste/duplicate Entities in CoreData.
(... i guess :0} )
some time saver. oops! hope this helps someone.
I had this same issue with Core Data entity class. I had forgotten to select Codegen Manual / None because I do not allow mine to be autogenerated. So I had a class in place and also it was trying to generate one.

Missing framework in ios develop of Xcode

I have removed the framework from Xcode workspace and modified every place that importing that framework, and together with the building Parse of the project setting.
As there is no error showed in Xcode, I thought it's fine to compile, but during link time, there is error shows that the removed framework still needed.
Note that I have already cleaned the ~/Library/Developer/Xcode/DerivedData/ folder with rm -rf *
So how to check why this specific framework still needed to be linked? where to config that?
This shows that we are good with Xcode editor no error showed.
And this shows I have already removed the formwork cause the problem from the link parse
And here is the error when linking the project
The thing turns out to be I also have to remove the framework from
project -> build phases -> Embed Framworks

‘Cloud/CLAPIEngine.h’ file not found

My application has been running fine with the Cloud-iOS.a library for the past few days. However, today, when I used the “Product > Clear Build Folder” command and tried to run the app again, it would give me this error:
‘Cloud/CLAPIEngine.h’ file not found
The Cloud library builds successfully, but the main project gives me that error along with 4 others in both the main project and the XCTest files (that are linked with this one).
I’ve tried removing and re-inserting the file from Build Phases > Headers and Build Phases > Compile Sources and that didn’t do anything (I also have tried to remove the -fno-objc-arc flag from the file to see if it would recognize it, and sure enough, it gave me an ARC error). I’ve tried looking through other SO questions like these:
Restkit/Restkit.h file not found Xcode 6.1
Adding frameworks to project in Xcode 5 and having *relative* paths added
... and nothing worked. I even tried restarting the app itself and nothing happened. I made a test project and included the same library to see if it’s my project, but this project also says the same errors. Both projects also have the file in the "include/" directory. I don’t know why this is happening and I’m starting to get really tired with Xcode’s random problems.
I’ve included the test project in a Dropbox link for others to check out and see why it’s doing this.
https://www.dropbox.com/sh/lu8hntaaww8y6r4/AAA1KJ085YvKjwMR-AZff6Nga?dl=0
What can I do to get this to run again? Thanks in advance.
(After this, I’m not running the “Clear Build Folder" command again.)
Ok. Looks like someone over at Apple Developer Forums was able to give me an answer. I chose the last one that they gave me, which was to change the static library into a framework. Thank goodness Apple made this available on iOS, because (after a bit of tweaking), everything works!

All RestKit projects fail to build when archiving

THIS QUESTION REFERS TO RESTKIT 0.9.x.
IF YOU ARE NEW TO RESTKIT CONSIDER USING THE NEWER 0.10.x branch.
I recently inherited a project that uses restkit (restkit.org). I have started using a branch (402-new-build-process) that is more compatible with xcode4.2.
My project an all the example projects build and run, but when it comes to Archiving an app the build fails:
/Users/AUser/Documents/SubFolder/stable-branches/project-iOS-client/RestKit/Examples/RKTwitterCoreData/Classes/RKTwitterAppDelegate.m:9:9: fatal error: 'RestKit/RestKit.h' file not found [2]
#import <RestKit/RestKit.h>
^
1 error generated.
I have followed the Installation Troubleshooting guide on the project wiki, but this did not work.
As per Blake's answer I am building to the DerivedData directory:
In addition I have tried setting header search to these (in many combinations [just guesses]):
"$(BUILD_DIR)/RestKit/Build"
"$(SOURCE_ROOT)/RestKit/Build"
"$(SOURCE_ROOT)/../../Build"
"$(BUILD_DIR)/../../Build"
I think all these fixes were stabs in the dark, or at least felt like that to me. I half expected to read one about getting some hair from a young virgin and burning it over the Mac.
If it compiles for you in dev but not for archive its bound to be something simple. Or at least it was for me.
My source files were not in the right place:
The search header was set to "$(SOURCE_ROOT)/RestKit/Build"
But I had simply dragged the proj file from where I downloaded it into XCode. This was never an issue when compiling for debug etc. Just when archiving so I didnt spot it for a while.
Just make sure what ever that path is to the RestKit/Build is where the actual files are.
Fixed it for me, unlike all the cross your finger fixes I've read. Like moving headers into a group etc... what a load of rubbish that was.
Good luck, hope this helps. Thanks to the Restkit team, this really is a great framework.
Jamie
I am building against the development branch and integrate RestKit as a submodule in my root git folder
+ root project folder
|--+ RestKit
|--+ <Projectname>
|--+ <Projectname>.xcodeproj
So I use the following search paths
"$(BUILT_PRODUCTS_DIR)/../../Headers"
"$(SOURCE_ROOT)/../RestKit/Build"
!!!Update to the latest version of the branch!!!
I've just built RKCatalog and RKTwitterCoreData as an archive on Xcode 4.2 without issue. I am failing due to a Code Signing issue. Have you confirmed that you are building with the DerivedData directory:
RestKit assumes that you are using a modern Xcode project building to the DerivedData directory. Confirm your settings
via the "File" menu > "Project Settings...". On the "Build" tab within the sheet that opens, click the "Advanced..."
button and confirm that your "Build Location" is the "Derived Data Location".
I can push changes that rsync the headers to a known location, but I was hoping that standardizing on DerivedData would simplify the process.
To reiterate Jamie Reynolds answer, most (if not all) of you have set your header search paths to "$(SOURCE_ROOT)/RestKit/Build", this is fine while debugging and also fine for archiving, unless of course your Restkit framework IS actually in this directory.
Like the majority of you out there, you have probably just linked to the framework from the default download directory, in which case go to finder, open Restkit->Build cmd+i to see the info and select the directory path, copy and replace "$(SOURCE_ROOT)/RestKit/Build", dont forget the brackets.
mine was "/Users/edwin-b/Downloads/RestKit-RestKit-8d0d9fc/Build" worked like a charm
I followed the steps outlined in several SO answers, and the issue ended up being a problem with the Header Search Paths. Sometime between adding RestKit in XCode 4.2 and trying to archive in XCode 4.3.1 (I had updated twice between starting the project and providing a build), a comma had been injected in the Header Search Path list which Xcode could no longer parse. As a result, the entry for RestKit's header location was:
"$(SOURCE_ROOT)/RestKit/Build",
When it should have just been:
"$(SOURCE_ROOT)/RestKit/Build"
While this didn't produce any issues building to device or sim, once I tried to archive, it caused the error reported by the OP.
Just add "$(SOURCE_ROOT)/RestKit/Build" to you target "Header Search Paths", Thanks to this answer.
I'm sure some of these are redundant, but I just spent over 3 hours debugging this thing and almost ruined my project in the process. So... Here you have it.
For the sake of your sanity, create a zip backup of your project before messing with RestKit project paths, commit all files (especially the project) to source control, cross your fingers, burn a virgin hair over your mac, then proceed.
After eliminating them one by one, I narrowed it down to this line allowing me to archive.
"$(SOURCE_ROOT)/../RestKit/Build"
Restkit is a folder at the same level as the main project folder
I'm adding this answer so I can find it later - it matches some responses above. Look in your targets "Header Search Paths" - and depending on where your restkit directory is in your project, add one of the lines specified above in Alex Stones answer. In my case, it was "$(SOURCE_ROOT)/../RestKit/Build"

Resources