Cannot find Objective-C pod on Swift - ios

I have this pod on my project:
Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'AFNetworking'
pod 'Parse'
pod 'Fabric'
pod 'Crashlytics'
pod 'MagicalRecord'
pod 'Socket.IO-Client-Swift'
pod 'SDWebImage'
pod 'MBProgressHUD'
pod 'HexColors'
pod 'SWTableViewCell'
pod 'AKPickerView'
pod 'CRToast'
pod 'MTDates'
pod 'JazzHands'
Project-Bridging-Header
#import <JazzHands/IFTTTJazzHands.h>
#import <MTDates/NSDate+MTDates.h>
#import <MTDates/NSDateComponents+MTDates.h>
I can use any MTDates function at any Objective-C or Swift file.
And I can use any JazzHands function/class at any Objective-C file, but when I try to use it on Swift like this:
import UIKit
class GICalendarViewController: UIViewController{
var separatorFrameAnimation: IFTTTFrameAnimation!
I've got this error:
Use of undeclared type 'IFTTTFrameAnimation'
I've tried to add #objc tag on this class, and this doesn't work.
Any ideas why this is happening?

You use these libraries as frameworks (use_frameworks!). So you have to add
import JazzHands
in your source files. The same you do with Cocoa's frameworks like UIKit.

Related

Upgrade to FirebaseCrashlytics and 'No such module FirebaseCrashlytics'

I am trying to upgrade to FirebaseCrashlytics from Crashlytics. I am able to import Firebase but not FirebaseCrashlytics. Here is my podfile:
platform :ios, :deployment_target => "9.0"
def shared_pods
pod 'Firebase/Crashlytics'
pod 'Firebase/Analytics'
pod 'SVProgressHUD'
pod 'IGHTMLQuery'
pod 'OpenTok', '~> 2.16.3'
end
target 'MyApp' do
#use_frameworks!
shared_pods
end
I cannot uncomment use_frameworks! since it breaks other pods I am already using.
My bridging header:
#import "FirebaseCrashlytics/FirebaseCrashlytics.h"
#import "FirebaseCore/FirebaseCore.h"
This is what I am getting:
According to the firebase docs then you just have to import Firebase, not FirebaseCrashlytics.
https://firebase.google.com/docs/crashlytics/get-started?platform=ios
If you're using it as a Swift framework then make sure you add it to your target's Frameworks, Libraries, and Embedded Content

swift linker command failed with exit code 1 Google Maps iOS Util pod install

My build failed with swift linker command failed with exit code 1. The logs specifically say symbol(s) not found for architecture x86_64
This happened ever since I tried setting up Google-Maps-iOS-Utils.
This is my Podfile. There is a pre_install portion because without it, pod install will have a 'Pods-Project' target has transitive dependencies that include static binaries error.
# platform :ios, '9.0'
target 'My App' do
use_frameworks!
platform :ios, '11.3'
# Pods for My App
pod 'GoogleMaps'
pod 'Google-Maps-iOS-Utils' #the new pod that caused issues
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'GoogleSignIn'
pod 'Firebase/Database'
pod 'Firebase/Storage'
pod 'FirebaseUI/Storage'
pod 'Fabric', '~> 1.7.9'
pod 'Crashlytics', '~> 3.10.5'
target 'My AppTests' do
inherit! :search_paths
# Pods for testing
end
end
pre_install do |installer|
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
end
This is my Bridging-Header.h
#ifndef Bridging_Header_h
#define Bridging_Header_h
#import <Google-Maps-iOS-Utils/GMUMarkerClustering.h>
#endif /* Bridging_Header_h */
Some troubleshooting measures I tried:
Cleaning Build Folder and Building again;
de-integrating pods and pod installing again.
Any help is appreciated. Thanks.
This solution worked for me. There is no need for this portion in the Podfile as well.
pre_install do |installer|
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
end
I also had to delete the framework the binary search path in Build Phases.
Try to add library location in binary search path of build setting.

Firebase ambiguous reference "FIRMessagingAPNSTokenType... is ambiguous"

After upgrading the Firebase Pods the project have ambiguous reference problems, any suggestions?
when I use the Pods with Version 4.10.0 it works perfectly, but if I use the latest version (5.0.0) I get the error.
My Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
target 'AppName' do
pod 'OpenSSL-Universal'
pod 'Firebase/Core', '4.10.0'
pod 'Firebase/Messaging', '4.10.0'
pod 'GoogleToolboxForMac/Logger'
pod 'AppCenter'
end
target 'AppName DEV' do
pod 'OpenSSL-Universal'
pod 'Firebase/Core', '4.10.0'
pod 'Firebase/Messaging', '4.10.0'
pod 'GoogleToolboxForMac/Logger'
pod 'AppCenter'
end`
Thaks and advance!!
This usually happens if you have the same class in 2 different frameworks. Can it be that you reference both 4 and 5 at the same time?
Try to comment out "BRy-Autenticador DEV" section and build only the 'BRy-Autenticador' target.
Check your Podfile.lock after running "pod install". It should contain only one version of Firebase frameworks.
I solved this problem writing...
[FIRMessaging messaging].APNSToken = deviceToken;
instead...
On didRegisterForRemoteNotificationsWithDeviceToken method.
Thanks!!

OBJC_META_CLASS Issue

Hi Team i am using following pod file in my single view application project
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
target 'projectbase' do
# Uncomment this line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for projectbase
target 'projectbaseTests' do
inherit! :search_paths
pod 'AFNetworking'
pod 'LGSideMenuController'
pod 'SDWebImage'
pod 'MBProgressHUD'
end
target 'projectbaseUITests' do
inherit! :search_paths
# Pods for testing
end
end
But As i am using "LGSideMenuController" in viewcontroller.h i am getting the Meta class error following is the code and screen shot of error
#import <UIKit/UIKit.h>
#import <LGSideMenuController.h>
#interface ViewController : LGSideMenuController
#end
Compilation with following line is OK
#import <LGSideMenuController.h>
But as i used
#interface ViewController : LGSideMenuController
error occurred
Can any one please help me to resolve this issue
Xcode version is 8.3.2
Please replace pod file with following code.
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
target 'projectbase' do
# Uncomment this line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
pod 'AFNetworking'
pod 'LGSideMenuController'
pod 'SDWebImage'
pod 'MBProgressHUD'
target 'projectbaseTests' do
inherit! :search_paths
end
target 'projectbaseUITests' do
inherit! :search_paths
# Pods for testing
end
end

ParseFacebookUtilsV4, Swift and CocoaPods: unresolved identifier

I'm developing an iOS App using XCode 7.0 beta 4 (7A165t) and Swift 2.0 that use Parse, Facebook and Google Maps. This is my Podfile:
platform :ios, '8.0'
use_frameworks!
inhibit_all_warnings!
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
pod 'GoogleMaps'
pod 'Parse'
pod 'ParseFacebookUtilsV4'
pod 'SWRevealViewController'
I tried to follow the Parse guide (https://parse.com/docs/ios/guide#users-log-in-amp-sign-up) but I receive this error
error: use of unresolved identifier 'PFFacebookUtils'
This is my Bridging Header
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>
#import <FBSDKShareKit/FBSDKShareKit.h>
#import <SWRevealViewController/SWRevealViewController.h>
#import <ParseFacebookUtilsV4/PFFacebookUtils.h>
#import <Parse/Parse.h>
#import <Bolts/Bolts.h>
Any suggestion?
Just import ParseFacebookUtilsV4 in your code
import ParseFacebookUtilsV4
this worked for me
Under your project's build settings, make sure that in Swift Compiler - Code Generation, your Objective-C Bridging Header path is set to yourProjectName/nameOfYourBridgingHeader.h

Resources