Been stuck on this past 2 days
I am trying to create my own dynamic framework on iOS 8.3. I needed to use FMDB in my framework.
With Cocoapods 0.36 installed, I did a pod install on the following Podfile
use_frameworks!
target "PoddedFramework" do
pod 'FMDB'
end
This works just fine and creates the required pod frameworks and workspace.
But, I can't find a way to use the FMDB pod in my own framework or my demo project that uses the framework.
#import <FMDB/FMDB.h>
This statement results in a "Could not build module 'FMDB'" build error in my own framework.
If I include the above statement in the public header of my framework and try to use that public header in my demo project, I get an error saying "File not found" for FMDB.h
I have seen a lot of questions regarding integration with swift, but could not find anything regarding objective-C
I have been working with that framework a few weeks ago and it has been one of my headaches, but yesterday (Feb 6, 2018) after trying many things, I made the following adjustments taking another FMDB project as an example.
After installing FMDB (2.7.2) with "pod install" and opening the .xcworkspace I thought it would be fine and I could use it, but no, I found some differences mainly in the option Search Paths -> Header Search Paths as I show in the image configuration pods Search Paths and configuration FMDBtest Search Paths.
Then link in my viewController.m with #import "FMDB.h", if it does not work, try the option #import <FMDB / FMDB.h>
Related
I am using Swift libraries in Objective-C Project with CocoaPods.
I tried running them in the recently released Xcode 8 GM and I am getting the following error:
I tried all the solutions in the below link and also from other SO Answers but nothing seems to work.
http://www.ios-blog.co.uk/tutorials/xcode/quick-tip-fix-use-legacy-swift-issue-in-xcode-8-beta-3/
Libraries I am using are Charts and XLPagerStrip.
You need to update your "Pods" project. For each Pod, choose the target and set it to use the legacy compiler. Note that if you do a "pod install" later, the workspace that gets generated will overwrite the legacy compiler settings, so you have to redo them.
I'm currently using Swift for an Objective-C project. Previously, I imported those Objective-C frameworks through bridging header since I did not use any Swift pods. But today, I need to use swift libraries such as Alamofire, which means I will need to use_framework! in my Pod File.
However, here comes the problem, after I pod install, and try to run the project on my device, errors jump up! What is even more odds is that everything works fine on simulator.
The errors are mainly about "Cannot find XX module" / "Cannot find XX local file" in objectiveC files.
I think it must have something to do with "use_frameworks" in cocoa pods. My question is how can I solve this problem? A million thanks beforehand, I have been scratching my head for this the whole day!
Go to Window -> Projects and Delete derived data. Then do a standard rebuild and it should work fine. I have run into this a few times when dealing with changing cocoapods.
My setup:
1) Cocoapod of Objective-C class installed in Swift 2.0 project works
2) If I attempt to import another Objective-C class, the addition of a bridging header seems to break the class imported by the Cocoapod.
I have an Cocoapod written in Objective-C I've successfully imported into a Swift 2.0 project. Everything works fine with that Cocoapod. I didn't have to do anything to get it to work--it just "worked".
When I attempt to import another Objective-C class into my project WITHOUT Cocoapods, the addition of the bridging header seems to break my previously imported Cocoapod. The moment I create a bridging header, my project stops seeing the original Cocoapod's classes.
I suspect the new bridging header is breaking something the Cocoapod set up, but I'm unable to find another bridging header in my project. If anyone has suggestions where to look for the issue, I would be grateful for them.
Update
I tried adding the 2nd non-Cocoapod Objective-C class WITHOUT adding a bridging header at the prompt and I get same error. No such module 'CocoaPodClassThatWorkedBefore'
I have no idea why or how this worked, but I went to the command line in my project's directory and reinstalled the Cocoapod using the following:
pod install
I had already installed the Cocoapod, but after adding another non-Cocoapod Objective-C class to a Swift 2.0 project, something got fouled up. Reinstalling the Cocoapod seems to have resolved the issue of Xcode not seeing the original installation.
For those who aren't familiar with Git or Github, I strongly suggest you learn it and have it implemented on your project before attempting this solution. Alternatively, have a clean backup of your project laying around in case it doesn't go according to plan.
Today I've updated to Xcode 6.2/iOS SDK 8.2 and I've updated my project's Parse framework to 1.6.4 simultaneously. Now, I'm getting this error:
Definition of 'PFInstallation' must be imported from module 'Parse.PFInstallation' before it is required.
and
Definition of 'PFFile' must be imported from module 'Parse.PFFile' before it is required.
Both manifest as errors, not warnings, though interestingly my app builds.
I think modules are a Swift thing, though I'm on Objective-C and my project has nothing to do with Swift. What should I do?
UPDATE: Cleaning the build folder and restarting Xcode and rebuilding got me rid of the installation one, though file error is still here.
Congratulations!
You've found (yet another) bug in Xcode.
File it on bugreporter.apple.com
Cause it's still there one major release later in xcode 7.2.1
and I have to rm -rf ~/Library/Developer/Xcode/DerivedData all the time
to have the project build and run
(I do have swift content in the outer framework of mine though)
UPD 2016.02.18 this either seems fixed in 7.3 beta 3 OR I have strategically killed an #import somewhere which took care of this. Do not hesitate to share YOUR experience in the comments and/or answers ;-)
Try to import the file with framework reference like this:
#import <Parse/PFInstallation.h>
I have been using the YouTube v2 APIs for a little while and now have finally gotten around to setting up v3. So I have downloaded their frameworks/libraries from here:
svn checkout http://google-api-objectivec-client.googlecode.com/svn/trunk/ google-api-objectivec-client-read-only
And looked closely at the instructions they give for adding it to your project here:
http://code.google.com/p/google-api-objectivec-client/wiki/BuildingTheLibrary
For the life of me I cannot get my app to compile with some sort of problem. Its either and ARC problem, can't find header files or all sorts of other errors.
Hoping someone can come along who has it working and simply put some 1 2 3 steps as it would make a lot peoples lives easier as I am sure the Google APIs of all varieties are pretty relevant to a lot of people and will continue to be, thanks.
I had the same problem recently. The quickest way I could find to get the new client library up and running quickly was to install with this CocoaPod project, called iOS-GTLYouTube.
CocoaPods is a really simple way to install libraries. If that's new to you, you can check out the instructions at cocoapods.org.
Install Cocoapods if you don't have it, using your system ruby:
$ sudo gem install cocoapods
Create a Podfile located within your project with the following:
platform :ios, '7.0'
pod 'iOS-GTLYouTube'
In your project directory, using the system ruby:
$ pod install