Swift 4.0 No such module 'libxmlKanna'? - swift4

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

Related

No such module 'GoogleAPIClientForREST'

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

Cant import module to xcode

I have the same problem as described here: I cant add socket.io module to my project.
I've tried all ways of dragging and dropping as described in answer, I've tried adding files to project from File menu. No matter what I do I get compile error "SocketIO module not found" on string import SocketIO
Is there a regular way of adding modules? Command line? Sorry if question sounds dummy - Im new not only to swift but to mac also (bought it to learn swift).
If that´s an issue (which it seems to be for not only you) I would go with CocoaPods instead.
Start by:
Do this in your terminal: sudo gem install cocoapods
Go to your project folder and open the terminal in that folder (cd ...)
Do this in your terminal: pod init
Remove all content in your newly created pod file and add this instead:
use_frameworks!
target 'YourApp' do
pod 'Socket.IO-Client-Swift', '~> 12.0.0' # Or latest version
end
Do this in your terminal: pod install
Open your project, note that you need to open the .xcworkspace file to be able to access your pods
Import the module import SocketIO
I created a sample project for you with CocoaPods installed and I have added SocketIO for you. Remember to run the .xcworkspace file. You can download the project here.
Add the socketio swift client with CocoaPods , but after that set the source of the client to Swift 3.2 then try to build it. I’m assuming you’re using Xcode 9 . To set the source to swift 3 from Xcode : go to Frameworks, select the SocketIO and go build settings and set Swift version to Swift 3.2
I faced this problem and it killed my 4 hours time.
I did the steps given by #Rashwan L but it didn't solve my problem though.
I was set iOS Deployment Target to 10.0 that was my main problem.
When I changed my iOS Deployment Target to 11.1 it works for me.
Good luck.

Using installed pod in swift project

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

how to import MBCalendarKit in your swift project

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!

com.badlogic.gdx.utils.viewport Doesn't Exist

Trying to import a viewport, more specifically a ScreenViewport, into a libgdx project project but the package doesn't seem to exist on my machine. According to the documentation and code other people have posted I'm using the right address but I'm getting an error.
import com.badlogic.gdx.utils.viewport.ScreenViewport;
"The import com.badlogic.gdx.util.viewport cannot be resolved."
Any idea what might be happening?
The most probable possibility is that you are using an old version of libgdx.
Try updating jar files in your project (manually or using ui).
Hope this helps.
Good luck.