I'm trying to implement Dropbox syncing to my iOS app using the ensembles framework. I'm not using pods, so I manually added the ensembles iOS and DropboxSDK Xcode projects to the frameworks section of my project, and made sure all the buildphases etc are taken care of (following the instructions on the ensembles github page). No problems so far, everything builds fine. But when I then add CDEDropboxCloudFileSystem to my project (see here), I get an error saying that DBRestClient.h cannot be found. I fixed it by replacing #import DBRestClient.h with #import <DropboxSDK/DropboxSDKh.h> in CDEDropboxCloudFileSystem.h and commenting out the two DropboxSDK related imports in CDEDropboxCloudFileSystem.m
Builds fine now, but is this the correct solution, or did I miss something with my setup?
(I tried adding the ensembles tag to this question, but I need a reputation of at least 1500 to do so)
If it builds, your solution is probably fine.
I guess whether you can import the framework header or not depends on how you are linking. Sounds like you are somehow linking a Dropbox framework on iOS. Is that right?
That might be a new option Dropbox have added for iOS 8. Previously, on iOS, you basically linked with a static library, and then you don't have the option.
Another way around the issue may be to add the path to the Dropbox headers folder to your header search path.
PS I also don't have the points to add an 'ensembles' tag :(
Related
I am currently working on integrating Google Calendar into my iOS project which uses GoogleAPIClientForREST And GoogleSignIn libraries. Project Git can be found here. I am able to add or read all my Google calendar events.
However, I have been asked to make it work without using Cocoa Pods. I have added all the necessary frameworks by dragging and dropping into my project, it builds and runs but I'm getting a crash at this line (attached screen shot for ref) GIDSignIn.sharedInstance().scopes = [kGTLRAuthScopeCalendar] .
Here's working screenshot where am getting the kGTLRAuthScopeCalendar element in array. (Using Cocoa Pods)
Here's screenshot where am getting a crash because the kGTLRAuthScopeCalendar element in array has 0 values. (Without Using Cocoa Pods)
Does anyone have any idea what I might have missed, or am I wrong in my implementation without CocoaPods if yes, how?. Please help.
SO links previously referred: 1. How to Create events using Google Calendar API iOS Swift , 2.https://code.tutsplus.com/tutorials/ios-sdk-working-with-google-calendars--mobile-19155
Does anyone have any idea what I might have missed, or am I wrong in my implementation without CocoaPods if yes, how?
Cocoapods is just a dependency manager and distribution mechanism — it doesn't add any actual functionality to your code on its own. You could simply remove the Podfile from your project and you'd be left with a working project that no longer "uses Cocoapods."
One of the lovely things about a dependency manager like Cocoapods is that it manages not only the things that your project needs directly, but also the things that those dependencies need, and so on. There are only two pods listed in your Podfile, but your Podfile.lock shows about 18 pods because the two that you use directly each depend on other pods.
I don't think there's nearly enough information in your post to let us really understand what specific thing(s) you've missed in removing Cocoapods, but from your screenshot it looks like you only have about six frameworks installed in your project while, again, your Podfile.lock shows many more pods than that. It may be that some of the frameworks you need are embedded inside top level ones in your project, but the fact that your project doesn't work correctly even though you're presumably using exactly the same source code is a strong indication that you've left out one or more of the frameworks you need.
Go through the list of pods in Podfile.lock and make sure that the framework each one specifies is included in your new project.
I'm developing an iOS framework that mixes Objective C and Swift code. Build fails at the #import "Example-Swift.h" line with 'Example-Swift.h' file not found.
The header file does get generated, I can find it at:
DerivedData/Example/Build/Products/Debug-iphonesimulator/Example.framework/Headers/Example-Swift.h
I tried all of the upvoted solutions on Stack Overflow, none worked. The only fix is manually adding the directory to User Header Search Paths in build settings.
I must be doing something wrong though if other people don't have to manually add the header path. Also, when users of this framework include it as a pod, they need to do update the build settings as well, which I really want to avoid.
So, is there a solution to this that's not an ugly hack? I'm using XCode 9.0.1. I wish Xcode / iOS had a normal build system... coming from Linux/Android, I like many things about the iOS ecosystem but the build system is just ridiculous.
I've seen this problem in a mixed Objective-C/Swift framework and my solution was to include the module name as the directory part of the include. In your case it would be
#import "Example/Example-Swift.h"
instead of
#import "Example-Swift.h"
This is actually documented in the Importing Swift into Objective-C subsection of Importing Code from Within the Same Framework Target at https://developer.apple.com/library/content/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html
I am using New Relic in my iOS app. In my original xcode-project things work as expected. When I check out the project from Git on another computer (or the same computer at another location), I am unable to find NewRelic.h. I get the following error when I try to build:
'NewRelicAgent/NewRelic.h' file not found
The framework is added to Git, and I use several other third party frameworks that work without problem. If I remove the New Relic import the rest of the project work as expected. In the non-functioning version that I check out, I have even tried to remove New Relic and re-add the framework, but this produces the same error.
I have searched the project for any absolute search paths, but it seems like there are none. I would like some advice on how to make xcode find the file.
This actually looks like a problem with xcode. A few users found a very simple fix that's outlined here: Why are static library headers not found?
Should be as simple as renaming the folder that contains the .xcodeproject.
I had this error when following their install instructions and imported the framework in the precompiled header. When importing it in the app delegate (which they explicitly state you should NOT do with the new version) everything works. Might be something with XCode6.1. Don't know.
First of all, my project builds fine initially.
Then I integrate VideoStream SDK for iOS into a standalone app, and it works.
Then I integrate VideoStream SDK into my actual project, and set up search paths for header files for the library, but then my project gets these issues:
I'd have a look if one of your source header files has the same name as a standard C++ or C header file. Quite possibly this prevents inclusion of the standard header file that defines struct tm. Look if there is a file "time.h" or "locale.h" or something like that has become part of your project.
I have not seen this solution posted ANYWHERE after so much time googling since the time I posted, but I disabled Always Search User Paths under Search Paths of Build Settings, and the project built.
I'm relatively new to XCode and iOS. My background for understanding how to add libraries/dependencies to a project is in the world of Java and Maven.
I need to add AFNetworking to my project and have been unable to do so successfully.
First, I tried going to my project -> Build Phases -> Link Binary With Libraries, clicking the "+" button, and then search for AFNetworking from the list. It wasn't in the list.
So, I figured I'd have to add it using the "Add Other..." option. Which means, of course, I'd need to download AFNetworking somehow. I'm not sure I was able to download it in the correct form -- it seems all I could get was the AFNetworking project itself, rather than a framework (if I understand correctly, frameworks are analogous to jars? Can you generate a framework by building an iOS project in a certain way?). I downloaded it from their GitHub page. (I also tried their "Getting Started" guide, but it had me using CocoaPods, which I couldn't get to work right and I'd rather avoid it for now.)
I've tried adding project files and folders from AFNetworking just to see if they worked (but of course they don't -- I think I need some sort of .framework file).
Bottom line: I can't seem to find a way to add AFNetworking to my project. How can I do it?
It sounds like you got the first part down, which is downloading it from the GitHub page.
When I follow this tutorial, it shows how they imported AFNetworking into their own sample project (that is, you'll see a "AFNetworking" group in the list of files and folders along the left side of your Xcode window).
Once AFNetworking is building along with the rest of your code in your project, you should be able to call into the various AFNetworking API's from your code. You'll need to make certain to add in the appropriate "#import "AFNetworking.h"" lines into your source code files from which you'll be calling AFNetworking.
Use pods, than you wont have to upload AFNetworking to your github project, and there is no worry about wrong linkers etc.
Use pods: install pods
Instalation AFNetworkign with pods: install AFNetworking
I believe if you download their code you can generate the .a file using the process in this stack overflow answer: (obviously replacing the project they are getting from gihut with the project you found)
How to create framework from Xcode 4 project?
Use this Manager to help you use AFNetwork.