No such module 'SCSDKCreativeKit' - swift

I believe the Snap Kit SDK may be faulty. I created a completely new iOS project, setup the Cocoapods workspace and then added:
pod 'SnapSDK'
With a sucesfull installation. I then as per the tutorial:
In my view controller added:
import SCSDKLoginKit
However I'm getting the error: No such module 'SCSDKLoginKit'
Any help would be appreciated.

The Cocapods installation method seems to be bugged at the moment. Instead of using CocoaPods, use Carthage to install. This should fix the error, as it fixed it for me.

Try to download individual SDKs to add to your project separately. In your Podfile, specify which kit you want. Each can be used independently.
This resolved issue of No such module 'SCSDKLoginKit'
pod 'SnapSDK', :subspecs => ['SCSDKLoginKit', 'SCSDKCreativeKit', 'SCSDKBitmojiKit']

Related

Installing Package with CocoaPods

I'm trying to install the Charts package to use with CocoaPods and it keeps saying "No such module 'Charts'".
If I added the pod 'Charts' in the podfile, and did a pod install and the files are there in Xcode, how come it still gives me an error when I try to import Charts?
Do I still need to do the steps below? Or does CocoaPods do it for me?
Drag the Charts.xcodeproj to your project
Go to your target's settings, hit the "+" under the "Embedded Binaries" section, and select the Charts.framework
My pods file looks like this now:
You just have to hit Command-b to build, then the error will go away. The other solution is to hit Product > Build.
I had a similar problem when I was developing an app for an older platform. The CocoaPod I sourced supported Swift 4 but I was developing for Swift 3. When I sourced the last Swift 3 version of the pod, the "No such module" error was no longer there. Try the following line in your Podfile:
pod 'Charts', '3.0.3'
instead of the latest version.
try installing it manually moving the complete charts folder to your project, or downloading using carthage, it's way more cleaner using carthage than cocoapods because it doesn't create you a .xcworkspace like cocoapods.

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.

Upgraded Firebase - Getting error on FirebaseApp.configure()

I upgraded Firebase today and now I am having a very unusual problem
Use of unresolved identifier FirebaseApp.
I have done everything as per the documentation provided by firebase here. I have insert GoogleService-Info.plist on my project and pod i have install are as follows:
pod 'Firebase/Core
pod 'Firebase/Database
pod 'Firebase/Messaging
I am using XCode 7.3.1 and my deployment target is 9.0
Any insight you can give is greatly appreciated! Thank you!
I had the same problem. They have renamed it to FIRApp.
Use FIRApp.configure() instead
It seems this is a potential bug in the latest release.
Try specifying import FirebaseCore instead.
On the terminal, run
pod update
solves the problem
I had a similar issue. Try deleting and uploading you Google file this way:
Instead of dragging the Google file directly into your Xcode project, right click the folder (inside your Xcode project) that you would like to save the Google file and click "Add Files to '[App Name]'..." and add GoogleService-info.plist that way. Also make sure the file is called "GoogleService-info.plist".
Install relative Firebase packages
pod 'Firebase/Analytics'
Import Firebase in Xcode
#import <Firebase.h>
Add firebase configure. I attached screenshot
if ([FIRApp defaultApp] == nil) {
[FIRApp configure];
}

Cocoapods: Cannot load module 'Alamofire' as 'Alamofire'

Update: I solved the question. Please see my answer below (underneath the question and comments).
This question was marked as a duplicate, but it's different because it is a brand new error that I couldn't find through any searches.
I tried installing Alamofire into my XCode project.
As per their their tutorial, I installed cocoapods onto my system.
I then navigated to the folder of my existing xcode project in the terminal, and did:
pod init
I then edited the new pod file and added:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!
target 'RainyShinyCloudy' do
pod 'Alamofire', '~> 4.4'
end
Finally, I executed the command:
pod install
My terminal told me the install was successful.
But when I opened the .xcworkspace, made a new swift class and tried to import Alamofire, I got this error:
One possible reason could be that I had tried to install an earlier version of alamofire earlier, deleted it and then installed this.
But I really don't know how that could have mattered.
Thanks for any help you guys can give me.
Actually it failed because you were trying to import AlamoFire and not Alamofire. Imports are case sensitive.
Update: I posted an answer earlier that was wrong.
But now I actually figured it out.
I made a new project, went to the settings menu by clicking on the name of my app in the project explorer.
Then I went to Linked frameworks and libraries which is at the very bottom of the General tab.
I pressed that little + icon, selected Alamofire.framework. and set the status to required
Following this, cleaning and rebuilding the project made the error go away.

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