I want to use this Objective C pod in my Swift project : EAIntroView
I found in this SO answer :
Cocoapods 0.36 and above introduces the use_frameworks! instruction
which implies that the bridging header is not required for importing
Objective-C pods in Swift.
but I can't import EAIntroView and use the code of the Library
Here is my pod file
# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
use_frameworks!
target 'PROJ' do
pod 'Koloda', '~> 2.0.3'
pod 'EAIntroView'
end
target 'PROJTests' do
end
target 'PROJUITests' do
end
Cocoapods compiled it as framework, try to use #import EAIntroView
Related
My Pod file looks like this
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
target 'MyApp' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for MyApp
pod 'GoogleMaps'
pod 'Alamofire', '~> 4.0’
pod 'SDWebImage', '~>3.8'
pod 'Applozic', '~>3.8'
pod 'Google-Maps-iOS-Utils'
end
When i install pod with all this framework Stated it gives me This error
[!] The 'Pods-MyApp' target has transitive dependencies that include static binaries: (/Users/Mad/Downloads/MyApp/Pods/GoogleMaps/Frameworks/GoogleMaps.framework)
Please help me.
I'm not saying that the answers above are wrong, but I recently cd'ed into the project instead of the project-folder which resulted in the same output.
You have to download the Utils repository locally and then import to your xcode project. A step by step guide can be found here: Integrating with Swift projects which use 'use_frameworks!' in the Podfile
Firebase for iOS is an Objective-C framework which recommends integration using Cocoapods. Here's how I'm trying to set it up:
I am running Xcode 8b6 on OS X 10.11.6. The app is being built with the iOS 10 SDK, targeting iOS 9.
MyApp is the regular (Swift) iOS app I want to use.
MyFramework is an embedded dynamic framework with the app, q. I would like all the Firebase code to be abstracted away into the framework, and therefore add Firebase to the MyFramework target in my Podfile:
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
target 'MyApp' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for MyApp
target 'MyAppTests' do
inherit! :search_paths
# Pods for testing
end
end
target 'MyApp' do
pod 'Firebase'
pod 'Firebase/Database'
pod 'Firebase/Auth'
end
On running pod install, I am able to import Firebase in all .swift files in MyFramework. However, on using import MyFramework anywhere in my app, I get the error Missing required module Firebase.
Thinking this could be a Cocoapods issue, I started a fresh project and integrated Firebase manually, but ended up with the same issue.
Is this a known issue? If so, are there any fixes for it?
In the podspec of MyFramework, add dependency of the Firebase pods. Also set the static framework flag as true. This is how your podspec should look:
*OTHER METADATA RELATED TO MYFRAMEWORK*
s.static_framework = true
s.dependency 'Firebase'
s.dependency 'Firebase/Database'
s.dependency 'Firebase/Auth'`
May be you can include this in your podfile
//As you are targeting iOS 9.0
platform :ios, '9.0'
use_frameworks!
def firebase_pods
pod 'Firebase'
pod 'Firebase/Database'
pod 'Firebase/Auth'
end
target 'MyApp’ do
firebase_pods
Let me know if this doesn't work for you, i can try to help in other way i could
My iOS app contains both objective-C and Swift code. Now i have added use_frameworks! at the top of pod file to use some swift library. Unfortunately it started giving compilation errors.
My pod version : 0.39.0
It started complaining about imports in bridge.h file
Pod file contains objective-C libraries. Now i want to add swift libraries.
How can i fix this issue. Let me know if needs more details
use_frameworks!
platform :ios, '9.0'
xcodeproj 'Test.xcodeproj'
def devDependecies
pod 'SocketRocket'
pod 'CocoaLumberjack'
pod 'MRProgress'
pod 'GRMustache', '~> 7.3.0'
pod 'Realm', '=0.96.2'
pod 'ADALiOS'
pod 'Office365/Outlook'
pod 'Office365/Discovery'
pod 'AFNetworking'
#https://github.com/youtube/youtube-ios-player-helper/issues/160
pod 'youtube-ios-player-helper', :git=>'https://github.com/youtube/youtube-ios-player-helper', :commit=>'head'
pod 'iOSCalendarEventParser', '=0.0.4'
pod 'OneDriveSDK'
end
target 'Test' do
devDependecies
end
Sample error in bridge.h file :
But this file exists under pod directory.
'youtube-ios-player-helper' can compile as a framework.
So remove it from the bridge header and just add an import line in your Swift classes
import youtube-ios-player-helper
Do the same for all pods that can compile as a framework
At this moment Xcode does not allow that. use_frameworks works only with swift pods or libraries. If you add an objective C library you need to use the bridging header, therefore you need to remove the use_frameworks instruction in order to make it work. The only work around I found is to only import through pods the objective C libraries and the swift libraries you can add them manually. You can copy the classes names and content and use them as if you would have created them.
Is there a way to install this library without cocoapods ? because when i install it with pod i get this error :
[!] Pods written in Swift can only be integrated as frameworks; add `use_frameworks!`
to your Podfile or target to opt into using it. The Swift Pods being used are:
CryptoSwift and JSONWebToken
And when i add 'use_framewords!' i got error on the other libraries written with objective-c that use pod also
Here is my podfile :
source “https://github.com/CocoaPods/Specs.git”
platform :ios, '8.1'
pod 'GoogleMaps'
pod 'RSKImageCropper'
pod 'AFNetworking', '~> 3.0'
pod 'DZNEmptyDataSet'
pod 'Instabug'
Thank's in advance
You can drag and drop the
link
sources into your project. If you add the library in this way, you
will update the library manually as you know.
The second option is using cocoapods and solving the problem. When you use use_frameworks! cocoapods tries to convert the whole pods as framework, so the error should be in your bridging header. Try to import your frameworks in your files.
I'm developing a Framework for iOS where I need Alamofire but when I'm compiling my framework I got the following error:
Module Alamofire has no member named request
I also need Dollar in my Framework so here is my Podfile:
source 'https://github.com/CocoaPods/Specs.git'
link_with ['VTStarterFramework', 'VTStarterFrameworkTests']
platform :ios, '8.0'
use_frameworks!
pod 'Alamofire', '~> 3.0'
pod 'Dollar'
I also have set in Build settings the Build Active Architecture Only to
Debug = YES
Release = NO
I would appreciate any help.
Thanks in advance.