Quickblox-WebRTC iOS: QBRTCVideoRenderer property has error for rendererView, unknown type view - quickblox

I have used Quickblox-WebRTC, but it fails to import in swift files
Here is my pod file looks like:
platform :ios, '9.0'
# Uncomment this line if you're using Swift
use_frameworks!
target 'QuickBloxCall' do
pod 'QuickBlox', '~> 2.6.6'
pod 'Quickblox-WebRTC', '~> 2.2'
end
I have included the QuickbloxWebRTC and Quickblox in my Bridging header.
And I am getting below error while compiling:
Can somebody point out what I did wrong?

Found it. Very silly mistake of mine. Just add #import <UIKit/UIKit.h> as first statement

Related

Why do we need to use target "PROJECT_NAME" do from what version of cocoapods / xcode

Recently in my new MACI've installed cocoa pods 1.2.1 i ran "pod update" in my projects Folder to update to the newest Version.
The result of the update is:
The dependencyFlurrySDKis not used in any concrete target.
I've fixed the problem by adding pod like this
target "PROJECT_NAME" do
pod 'FlurrySDK'
end
But Just for curiasity...
I want to know from which version of XCode / Cocoapods we need to add this line
target "PROJECT_NAME" do
and Why
Can some one please clarify on this
Your pod file will be like this,
it is necessary to add your project name as "target".
Consider this code:
# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
# Uncomment this line if you're using Swift
# use_frameworks!
target 'PROJECT_NAME' do
pod 'FlurrySDK'
end
I hope it will help you, because i always add this for adding pods.
i think it is not XCode version based.

ld: library not found for -lGoogleToolboxForMac

I am implementing firebase setup via pods.
My Pods file looks like following one.
# Uncomment the next line to define a global platform for your project
platform :ios, '8.0'
# $(PROJECT_DIR)/build/Debug-iphoneos/GoogleToolboxForMac lib search path
target 'ProductName' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for mCura
pod 'Firebase/Core'
pod 'Firebase/Messaging'
end
Everything is fine with iPad simulator. its running but when I run my application in iDevice. It shows library not found.
ld: library not found for -lGoogleToolboxForMac
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have already wasted 2 days for removing this error & tried everything I could find on net. And GoogleToolboxForMac library automatically installs when firebase pod get installed.
I change my pod file to following code and re-install pod. It installed all necessary files for GoogleToolboxForMac.
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
target 'ProductName' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
pod 'Firebase/Core'
pod 'Firebase/Messaging'
pod 'GoogleToolboxForMac', '~> 2.1'
end
After Installing pod
1) Change Scheme to Generic iOS Device and Build.
2) After build success you can see libGoogleToolboxForMac.a file in black colour instead of red.
3) Now select Device and run build on iDevice. Follow screenshot.
Or you can have build library libGoogleToolboxForMac.a
I was also getting this exception:
It fixed after opening the /platform/ios folder in Xcode instead of /platform/ios/MyApp.xcodeproj file.
I got the same error and it was fixed just by opening the project from the .xcworkspace file instead of the .xcodeproj.
Sigh.
For my Cordova project I just removed plugins, platforms and node_modules, readded IOS, and double clicked instead of using alt-down to open the xsworkspace and suddenly it magically worked.
Posting this here so I remember that it might be unnecessary to look for a real solution.
This StackOverflow question: Framework not found GoogleToolboxForMac had the answer that fixed this for me, but it was not the most highly upvoted answer. I had to go to the build settings for the GoogleToolboxForMac target and change the "Build Active Architecture Only" setting from Yes to No. Then clean and rebuild.

Updating pods (Charts) to the latest Swift syntax

Currently I am using Charts pod in my Objective-C project, so I had to open it today in Xcode 8.1 and of course, I got this message:
This wouldn't be a problem if it was my code, but we are talking here about pods. So, what would be the proper way to handle this warning and switch to Swift 3 syntax for this pod?
What I have tried:
I have run pod update command, and updated it hopefully to the latest version...Still, I am getting the same message when I open Xcode. This is my Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.2'
pod 'Charts', '~> 3.0'
use_frameworks!
target 'drivingCOACH' do
pod 'Charts', '~> 3.0'
end
The Charts pod is documented on https://cocoapods.org/pods/Charts.
Current version (at the time of the question) is using Swift 3.0. So when using it, all your dependencies must be using Swift 3.0 too (you can't mix dependencies of different Swift versions when using Frameworks, which is currently a mandatory requirement).
You could manually change build settings to specify that each pod target is for Swift 3.0 (by setting "Use legacy Swift" value to NO). But because your project is in Objective-C, you may end up to do this operation each time you run pod install.
To avoid that trouble, you can extend the installation script of your Podfile to include those lines, and it will perform exactly the same as above on your next pod deintegrate && pod install:
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
Those lines won't be needed anymore the day you decide to integrate some Swift code to your app, because CocoaPods will then match the dependencies Swift version to what you are using.
Also, you may need to delete your Derived Data folder (~/Library/Developer/Xcode/DerivedData by default) while Xcode is closed if you face some cache issues.

How to use Objective-C CocoaPods in a Swift Project

Is there a way I can use a CocoaPod written in Objective-C in my Swift project using swift?
Do I just make a bridging header? And if so, can I access the objects, classes, and fields defined by the libraries in the CocoaPod in Swift?
Basic answer to your question is Yes, you can use objective-c code built with CocoaPods.
More important question is "How to use such libs?"
Answer on this question depends on use_frameworks! flag in your Podfile:
Let's imagine that you want use Objective-C pod with name CoolObjectiveCLib.
If your pod file uses use_frameworks! flag:
// Podfile
use_frameworks!
pod 'CoolObjectiveCLib'
Then you don't need add any bridge header files.
Everything that you need is import framework in Swift source file:
// MyClass.swift
import CoolObjectiveCLib
Now you can use all classes that are presented in lib.
If your pod file doesn't use use_frameworks! flag:
// Podfile
pod 'CoolObjectiveCLib'
Then you need create bridging header file and import there all necessary Objective-C headers:
// MyApp-Bridging-Header
#import "CoolObjectiveCLib.h"
Now you can use all classes that are defined in imported headers.
In podFile use the flag use_frameworks!
Inside Xcode in the Pod folder structure in the dependency, you add xxxxxxx-umbrella.h in Support Files.
In your {PROJECT_NAME}-Bridging-Header.h use:
#import "xxxxxxx/xxxxxxx-umbrella.h"
It works for me.
You just need a bridging header and import there what you need.
AND don't forget to add Bridging Header file name to Target -> Build Settings -> Objective-C Bridging Header

Cocoapods podspec dependency import file not found

I'm trying to make a Cocoapod that depends on another but I'm having issues at compile time. Say in this case MyApp is using CocoapodA and CocoapodB, B relies on A.
MyApp Podfile:
platform :ios, '5.0'
pod 'CocoapodA'
pod 'CocoapodB', :path => '../../CocoapodB'
CocoapodB Podspec:
s.dependency 'CocoapodA'
but when I try to compile I get 'CocoapodA/CocoapodA.h' file not found where the import in CocoapodB is trying to include it.
I've tried reading the Podspec documentation but I didn't really get what I'm missing. I also tried s.library = 'CocoapodA'.
Make sure that you correctly specify header files for CocoapodA, for example:
s.public_header_files = 'CocoapodA/**/*.h'
My problem ended up being that the OTHER_LDFLAGS were being overridden. After selecting the Other Linker Flags key (build settings) and pressing backspace it now builds.
Weirdly I can only build on actual device; both simulator and archive are failing. They're probably caused by something else.