No such module PDKClient with Cocoapods - swift

I have installed the Pinterest SDK with cocoapods successfully, but when I try to import PDKClient, it says "No such module PDKClient".
My podfile:
target 'MyPin3' do
pod "PinterestSDK", :git => "https://github.com/pinterest/ios-pdk.git"
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for MyPin3
end
I definitely have my xcworkspace open and I have tried clean + build. I've looked up some other Stack Overflow answers (tried deleting framework search paths, etc.) with no luck.
Any help would be appreciated. Thank you.

Rather than PDKClient, you should be importing PinterestSDK. Try this line and it should work:
import PinterestSDK

Related

No such module 'FacebookCore' in swift 5

I am doing my own test app as part of my learning process in iOS development (using swift 5 on Xcode 11.0). I want to add login with Facebook on my login page but I keep getting No such module 'FacebookCore' when importing the library.
I followed the instructions on developer.facebook and tried to implement the SDK using cocoaPods and here is my Podfile
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'TestApp' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for TestApp
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
target 'TestAppTests' do
inherit! :search_paths
# Pods for testing
end
target 'TestAppUITests' do
# Pods for testing
end
end
After executing pod install and adding the data in my info.plist as instructed by Facebook, I can clearly see that the framework has been linked in the Link Binary With Libraries section
But still, I can't seem to import FacebookCore nor FacebookLogin.
PS: I tried several solutions like:
1- Running the .xcworkspace instead of .xcodeproj
2- Building the project even with the error being displayed (some said it would go away)
But none of them worked.
I suspect that the problem is in my Framework search path but why would it be wrong in the first place? so I may be wrong, here's a screenshot to my search path anyway:
So it turned out that I have to import FBSDKCoreKit instead of FacebookCore which was not mentioned in facebook's documentation. And it should be imported strictly using the .xcworkspace file which was also not mentioned in the documentation.
Use FBSDKCoreKit instead of FacebookCore
This are the correct pods
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
and your imports should be
import FBSDKCoreKit
import FBSDKLoginKit
in previous version there was FacebookCoore as wrapper for the FBSDKCoreKit classes. It looks like Facebook has removed this since v5.x.
The following should be your entries in Podfile
pod 'FacebookCore'
pod 'FacebookLogin'
and your imports should be
import FacebookCore
import FacebookLogin

Xcode can't find cocoapods module

I feel like this should be so simple yet I can't get this to work.
I simply downloaded a test project from github here, and installed the required module 'CryptoSwift' from cocoapods.
I build the project and I just get riddled with errors:
I've cleaned the project, deleted and started over but I can't get this to work at all. Any help would be greatly appreciated.
Your CryptoSwift download framework is not compatible with your code. If you use swift 4, use the following version:
pod 'CryptoSwift', '~> 0.7.1'
Swift 3:
pod 'CryptoSwift', '~> 0.7.0'

When I compile the application I get an error equal to this: Could not build Objective-C module 'Firebase'

None of my 'Firebase' pods are found.
I updated to Xcode 9.
Ran 'pod update'
deitegrated my pods, and re-installed
Deleted 'Derived Data' folder contents
Build from 'Generic Devices'
Added the paths in the Header Search Path in the Build Settings $(inherited)
and
"$(SRCROOT)/Pods"
and
"${PODS_ROOT}/Firebase/Core/Sources"
Cleaned, build, closed the app, re-installed Xcode, restarted the system, and did it all again.
2 Swift Compiler Errors are always there.
'FirebaseAnalytics/FirebaseAnalytics.h' file not found
and
Could not build Objective-C module 'Firebase'
I'm on Sierra 10.12.6
None of these has worked so far to get rid of them. Does anyone know of any other possible solutions?
Here is the pod file info.
Uncomment the next line to define a global platform for your project
platform :ios, '10.0'
target 'MP' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for MP
pod 'Firebase'
pod 'Firebase/Analytics'
pod 'Firebase/Core'
pod 'Firebase/Database'
pod 'Firebase/Auth'
pod 'Firebase/Storage'
end
------ UPDATE ------
as Hexfire suggested below. I removed pods and manually added the frameworks.
After some fiddling with the pathing for my MP.h file, that first error is gone, however now I am getting these compiler errors now...
:0: error: PCH file '/Users/.../Library/Developer/Xcode/DerivedData/MP-gwnwsbrisiyspxepcxkbrojwtfrs/Build/Intermediates.noindex/PrecompiledHeaders/MP-swift_ZJX6RAPYV1IT-clang_2SW1CJQDTFSBO.pch' not found: module file not found
clang importer creation failed
I built a .pch file 'MP.pch' and I pointed to it in the Build Settings Prefix Header with $(SRCROOT) with no luck. Do I have to put all of my Framework paths in there as well?
All of this seems related to the search paths. Does anyone have any other thoughts here? Perhaps an example of the build settings syntax? For example $(SRCROOT) with quotes or without? $(SRCROOT)/MP.pch or just $(SRCROOT)?
One of the good ways to make this work is by not using CocoaPods. You can grab all necessary Firebase libraries from here and use within your app (if link doesn't work, go here, and scroll down to "Integrate without CocoaPods").
After downloading:
Unzip and see the README file for which Frameworks to include in to your project.
Add the ObjC linker flag in your Other Linker Settings in your target's build settings.
This is a valid option and 100% workable.
P.S. If Firebase is the only pod you are using, you can quickly and safely clean your project from any CocoaPods trails by using pod deintegrate command.
Good luck!
If All Of this do not work Try this for once
run sudo gem install cocoapods
You can check your version by typing pod --version anywhere on your terminal.
Make sure you are using latest Version of it

cocoapods Google Mobile ads does not generate .xcworkspace file

I am exporting a project from Unity3d to xcode that uses the last GoogleMobileAds package.
I have installed and updated cocoapods and also have the famous podfile containing de following lines:
source 'https://github.com/CocoaPods/Specs.git'
install! 'cocoapods', :integrate_targets => false
platform :ios, ‘8.0’
target ‘MyProject’ do
pod 'Google-Mobile-Ads-SDK', '~> 7.14’
pod 'Firebase/Core'
pod 'Firebase/AdMob'
end
and I run
pod install
and
pod update
successfully
dependancies are downloaded alright, as you can see the results below:
Updating local specs repositories
CocoaPods 1.2.0.beta.1 is available.
To update use: `sudo gem install cocoapods --pre`
[!] This is a test version we'd love you to try.
For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.2.0.beta.1
Analyzing dependencies
Downloading dependencies
Using Firebase (3.9.0)
Using FirebaseAnalytics (3.5.1)
Using FirebaseCore (3.4.4)
Using FirebaseInstanceID (1.0.8)
Installing Google-Mobile-Ads-SDK (7.14.0)
Using GoogleInterchangeUtilities (1.2.2)
Using GoogleSymbolUtilities (1.1.2)
Using GoogleToolboxForMac (2.1.0)
Generating Pods project
Skipping User Project Integration
Sending stats
Pod installation complete! There are 3 dependencies from the Podfile and 8 total pods installed.
According to both cocoapods and google mobile ads documentation, I will need to continue with "MyProject.xcworkspace" but the file is nowhere to be found.
any suggestions?
When using install! 'cocoapods', :integrate_targets => false Cocoapods will not create an xcworkspace for you.
That's the intended behaviour. You'll even notice this if you follow the command prompt. This line is telling you that no integration is taking place.
Skipping User Project Integration
If you want to get an xcworkspace just remove :integrate_targets => false
It seems the problem comes from editing the Podfile using TextEdit.
As it warns you that you should not continue using TextEdit, one could falsely suppose that the program is intelligent enough to understand and correct these unwanted modifications.
This is the solution I have found:
delete the Podfile and Podfile.lock from your working directory
create a new Podfile using pod init
install SublimeText and use it to open the Podfile
add the necessary pods for the project
(I also included the line "use_frameworks!" although it may not be
needed.)
run "pod install" and "pod update"; this time I get
[!] Please close any current Xcode sessions and use Orbit.xcworkspace for this project from now on.
and the file is now available in project directory
You was used this guide for install pod?
In addition to Radu Dita's message. If you do not want that line to be added (so you do not need to delete it later), you need to disable cocoapods integration in "iOS Resolver Settings" by selecting "None", build project and then enable it back "Xcode Workspace". I found this with try and error. I hope my message will save save someone's time

No such Module 'SwiftyJSON' on Swift 3.0

After migrating to Swift 3.0, I am trying to import SwiftyJSON into my project. However, when I import the framework 'import SwiftyJSON' I get a No Such Module error.
If I remove the import statement, it does not recognize its classes.
Any advice as to why XCode might not be reading my imported framework?
See screenshots attached:
My problem was I was opening the project file and not the workspace file...
Try to check Targets-> Build Phases Link Binary With Libraries
There must be a link with SwiftyJSON
Updating my pod to reference the official SwiftyJSON gem worked for me! It updated from version 2.3.2 (what was installed by default via 'pod SwiftyJSON') to version 3.1.1.
So, in your Podfile, udpate your SwiftyJSON pod to:
pod 'SwiftyJSON', :git =>'https://github.com/SwiftyJSON/SwiftyJSON.git'
HTH
Clean your project and build again. Make sure you open project.xcworkspace.
pod 'SwiftyJSON'
remove import SwiftyJSON
to solve No such Module 'SwiftyJSON' on Swift 3.0
Swift can load the SwiftyJSON.swift by itself.
No need to specify it at import statement.
Ref: https://github.com/SwiftyJSON/SwiftyJSON/issues/49
Try this.
# Uncomment this line to define a global platform for your project
platform :ios, '10.0'
# Uncomment this line if you're using Swift
use_frameworks!
target 'Project names' do
pod 'SwiftyJSON', git: 'https://github.com/BaiduHiDeviOS/SwiftyJSON.git', branch: 'swift3'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
end
end
end
If you have multiple targets, try building each of them. I had two targets - one would build and the other would not. This may help you trace the issue.
In my case I just nuked my dev target that was not working, duplicated the production target, made a few settings changes, and was back in action.
clean your project and than build and run your project and than not work so remove your swiftyjson cocoa library in u r cocoapods and reinstall it should surely work and this 100% work for me ..so u try this.
This solution helped me. Build the modules individually, and then build your project.
https://stackoverflow.com/a/37732248/4899943
//import SwiftyJSON comment out first then
pod install
and then agian add
import SwiftyJSON
and pod install
it work for me
In your Xcode project go to podfile and enter :
pod 'SwiftyJSON'
Save and close the Xcode.
Open terminal and go to project directory and enter :
pod install
Open the project and Import SwiftyJSON in which file you want to use.