I am attempting to import GoogleAPIClientForREST but Xcode is unable to find the module. I installed the following pods:
pod 'GoogleSignIn'
pod 'GoogleAPIClientForREST/Calendar'
GoogleSignIn is working and looks like all of the necessary files for GoogleAPIClientForREST were created in the project. In addition, I created a bridging header file with the following code:
#import "GTMAppAuth/GTMAppAuth.h"
#import "GTMSessionFetcher/GTMSessionFetcherLogging.h"
Not sure what I am doing wrong? I know others have run into this issue and I went through all of the provided solutions to no avail. I think I may need to add drag GTLR.framework to the project's Linked Frameworks source group, but am not sure how to do that nor if I actually need to given I installed GoogleAPIClient via cocoapods. I am using Xcode 12.4 and a laptop with the M1 chip if that makes a difference.
Thank you for the help!
Figured it out: needed to add: #import "GTLRCalendar.h" to my bridging file and did not need to add: import GoogleAPIClientForRest at the top of my files
Related
https://github.com/tid-kijyun/Kanna
I use Manual Installation
Ive tried multiple variations of this, but none of them seem to work. Any ideas?
Thanks in advance.
I was facing the same problem, but I followed the instructions given here:
https://github.com/tid-kijyun/Kanna#manual-installation
And it works for me!
I am on Xcode 9.4.1. My project uses swift 4.1.
Make sure you give proper path
$(SRCROOT)/Modules
in the target Build settings to the Swift Compiler - Search Paths > Import Paths field.
Once this is done, remove the following import statement from your file:
import Kanna
From the github link you shared, it seems the easiest way is to add pod 'Kanna' to your podfile, run pod install in your terminal, build your project cmd + b and then add import Kanna in your project. You said import libxmlKanna ?? Just try import Kanna
I'm trying to create a swift program that uses sockets. In order to do that, I'm trying to use the SwiftSocket library by installing it using CocoaPods.
My Podfile is basic:
target 'socket' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for socket
pod 'SwiftSocket'
end
According to the installation guide of SwiftSocket, after installing the pod I should be able to use the TCPClient right away.
Still, I fail to use the class in my main.swift file as it doesn't find the class.
I've searched the web to see what I'm missing here, but all I found are guides on how to bridge Pods written in ObjectiveC but not on pods written in Swift.
Any help?
Thanks
EDIT: With jamshes reginahit suggestion, I've added SwiftSocket.framework to the Linked Frameworks and Libraries, in addition to the Pods_socket framework that was already present.
Now the build is successful, but I gut a runtime error of Thread1: signal SIGABRT with the payload:
yld: Library not loaded: #rpath/SwiftSocket.framework/Versions/A/SwiftSocket
Referenced from: /Users/jonathan/Library/Developer/Xcode/DerivedData/socket-buglawjxihebcabvcihcbdrtkcxt/Build/Products/Debug/socket
Reason: image not found
(lldb)
EDIT2: Something was funky with my Xcode. I've reinstalled it and now it seems to work fine. Thanks to everybody for the help. :)
I would like to comment, but I don't have enough reputation.
Anyway did you write something like:
import SwiftSocket
in the class where you need it? Also, did you open the project with the xcworkspace extension?
If nothing works try to clean and rebuild the project
Based on my checking of the SwiftSocket Library, it seems that what you did should be fine (it should be pod 'SwiftSocket' referring to "Installation" section), I assume that you missed to add :
import SwiftSocket
in your main.swift class.
And yes, they are not mentioning that in "Code examples" section because they -probably- assume that importing it in your .swift file should be obvious.
Once CocoaPods is finished installing, you need to start using the .xcworkspace instead of your .xcproject file. So close your project, open the workspace (same directory), and import SwiftSocket.
Your Podfile seems correct, after that, you need to launch a terminal from your project directory:
cd ~/Desktop/MyProject/
Then run: pod install command.
This will create a .xcworkspace file and a Pods directory.
Now you have to open the .xcworkspace file with Xcode.
Donc forget to import yout pod like this: import SwiftSocket
Also take a look at the CocoaPods documentation: https://guides.cocoapods.org/using/using-cocoapods.html
when I try to import MBCalendarKit in my project, it shows no such module error and linker command error. I tried all the solution given in stackoverflow under this topic and no success. help me.
Thanks in advance.
I've just imported into a test project, and using the latest version of Xcode (7.2.1) it's slightly different than the installation instructions.
Assuming you're using pods, install the pod and make sure to open the .xcworkspace file.
Next add a bridging header to the project, and import the main calendar kit file, like so
#import <MBCalendarKit/CalendarKit.h>
Inside your UIViewController subclass, import MBCalendarKit like so:
import MBCalendarKit
Celebrate!
I am trying to integrate ios-ntp into my project, which I develop using Xcode 7, swift 2.0 and cocoapods. I am adding the library as a pod. But when I try to add <ios-ntp/ios-ntp.h> to my app-BridigingHeader.h, Xcode doesn't recognize it. When I try to simply import the module and use it by #import ios_ntp ; Xcode complains that he is not able to build module 'ios_ntp'. Am I doing smth wrong?
upd. Actually Xcode is not able to build the module due to the error
'GCDAsyncUdpSocket.h' file not found
but that framework is present and added in 'ios-ntp' pod spec as dependent.
You shouldn't need to #import the library in your bridging header, Cocoapods should take care of making your pods available in Swift.
In your Swift files, have you tried import ios_ntp to import the library?
EDIT: Think I got it. Not 100% sure on why this is happening, but my hunch is that it's related to Cocoapods and ios-ntp's dependency on CocoaAsyncSocket. Something about ios-ntp's import of a CocoaAsyncSocket header is creating a circular dependency, which is borking ios-ntp's build.
Solution:
https://github.com/ruddct/ios-ntp should do the trick, that branch contains a few very minor header changes to forward declare the CocoaAsyncSocket stuff in ios-ntp's headers, which fixes the issue.
See How to prevent circular reference when Swift bridging header imports a file that imports Hopscotch-Swift.h itself for more background on this issue.
When you use Pods, you have to:
Open Pods.xcodeproj
In Targets select ios-ntp
Select 'Build Phases' tab
Add GCDAsyncSocket.h and GCDAsyncUDPSocket.h to Compile Sources and Headers
Remember to set 'Allow Non-modular includes in Framework Modules' to Yes in ios-ntp
For me, this works.
I have update the Parse SDK to 1.6.0 through CocoaPods.
IT works seems I am able to use the Local Datastore. However when I try to enable ParseCrashReporting doing
ParseCrashReporting.enable()
But Xcode does not find ParseCrashReporting.
Anyone having the same issue ?
Thank you !
ParseCrashReporting is in its own cocoapod spec. Make sure you add pod 'ParseCrashReporting' to your Podfile. Then import the headers as #Lucas pointed out.
Reference: http://cocoapods.org/?q=parsecrashreporting
I had the same issue and you should download the new Parse sdk, that comes with the following frameworks:
Bolts.framework
Parse.framework
ParseCrashReporting.framework
ParseFacebookUtils.framework
ParseUI.framework
In order to work, you should add the SQLite 3.framework and libstdc++.6.dylib to your project too
Don't forget to add on your Bridging-Header.h:
#import <ParseCrashReporting/ParseCrashReporting.h>
I'll also point out that as #cojoj mentions here, you should include use_frameworks! at the top of your Podfile to take advantage of umbrella headers. This blogpost lays it out clearly. It worked for me in getting the Parse SDK set up with CocoaPods and Swift.