I'm trying to install 'Google/Analytics' inside my lib project in podspec.
My project lib was created using pod lib create with Swift.
This is my podspec:
s.source_files = 'Pod/Classes/**/*'
s.resource_bundles = {
'LibPSLoginResources' => ['Pod/Resources/**/*.{xib,png,json}']
}
s.dependency 'FBSDKCoreKit'
s.dependency 'FBSDKLoginKit'
s.dependency 'Google/Analytics'
s.dependency 'Firebase/Auth'
s.dependency 'Firebase/Core'
s.dependency 'Firebase/Database'
My PodFile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
inhibit_all_warnings!
use_frameworks!
target 'LibPSLogin_Example' do
pod 'LibPSLogin', :path => '../'
target 'LibPSLogin_Tests' do
inherit! :search_paths
end
end
But when always run pod install I get this:
target has transitive dependencies that include static binaries: (/Users/macpr/Documents/Projects/iOS/LibPSLogin/Example/Pods/Google/Libraries/libGGLAnalytics.a and /Users/macpr/Documents/Projects/iOS/LibPSLogin/Example/Pods/Google/Libraries/libGGLCore.a)
I already try to put this code inside my PodFile, but the Google Analytics can't be imported by .swift file.
pre_install do |installer|
def installer.verify_no_static_framework_transitive_dependencies; end
end
As far as I know, the library project can't import static library. But what can I do to solve this problem?
Can anyone help me?
Thanks
As you may know, since Cocoapods 1.5, and possibly 1.4, it has become possible to overcome the infamous transitive dependencies issue. My approach has been to use the static framework approach now possible that means you no longer need to use #use_frameworks! in the Podfile, but instead use use_modular_headers! More can be found in the blogpost introducing Cocoapods 1.5: http://blog.cocoapods.org/CocoaPods-1.5.0/
As I know, this is impossible for such libraries. I faced the same issue several weeks ago.
https://github.com/CocoaPods/CocoaPods/issues/6526
You can take advantage of Carthage to install pure Swift framework like the repo I put it up: https://github.com/Lucashuang0802/CocoaPodsWithCarthage
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
After I converted the project to swift 3 I'm getting this error in Test.swift file:
No such module 'Firebase'
Command/usr/bin/ditto failed with code 1
is that mean I have to update the firebase framework? Why that happened?
*The application still runs though!
*Here's the pod file:
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
use_frameworks!
target 'TheTestingApp' do
pod 'Firebase'
pod 'Firebase/Auth'
pod 'Firebase/Database'
pod 'Firebase/Storage'
end
The issue is you are using the mentioned Cocoapods for TheTestingApp only you also need to add these or the Cocoapods you wanna use for the TheTestingAppTest
Also Clean your project : - CMD+SHIFT+K, Then run pod install & then run your app.
Something like this:-
use_frameworks!
target 'TheTestingApp' do
pod 'Firebase'
pod 'Firebase/Auth'
pod 'Firebase/Database'
pod 'Firebase/Storage'
end
target 'TheTestingAppTests' do
pod 'Firebase'
pod 'Firebase/Auth'
pod 'Firebase/Database'
pod 'Firebase/Storage'
end
I've been using Firebase in my personal project and I was able to do my Unit Test but tonight I encountered this annoying error in my new project. While Dravidian's answer is correct, it is a bit incomplete and code is redundant. I wrote a blog about this: http://www.prettyitgirl.com/2017/07/how-to-fix-missing-required-module-in.html and to summarize, here are the steps on how I solved this problem :)
Make sure that all your dependencies are targeting Swift 3.0 version and add your test target under your main target, like so:
target 'ProjectName' do
pod 'Firebase/Auth'
pod 'Firebase/Core'
pod 'Firebase/Database'
pod 'Firebase/Messaging'
pod 'Firebase/Storage'
target 'ProjectNameTests' do
inherit! :search_paths
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
end
Add a search path in your Header Search Paths
In your Tests target’s Build Settings, search for Header Search Paths and add these two new search paths:
$(SRCROOT)/Pods (recursive)
${PODS_ROOT}/Firebase/Core/Sources (non-recursive)
EZ! :)
Adding ${SRCROOT}/Pods/Firebase/CoreOnly/Sources on my Unit Test Target's HEADER_SEARCH_PATHS or Header Search Paths fixed it for me.
To add it to the Header Search Paths:
Go to the Unit Test Target
Click Build Settings tab
Search Header Search Paths
Double click to trigger input view
Paste ${SRCROOT}/Pods/Firebase/CoreOnly/Sources
Clean and build it again and it should be good to go
Ref: https://github.com/firebase/firebase-ios-sdk/issues/16#issuecomment-449701843
you check your podfile its already in declare at that time your project has been clean (ctrl+shift+k) Otherwise podfile data erase and again podfile install its should better work..
When I enter pod 'Firebase/Auth' it isn't installing the pod. Its saying this: [!] Unable to satisfy the following requirements:
Firebase/Auth required by Podfile
None of your spec sources contain a spec satisfying the dependency: Firebase/Auth.
You have either:
out-of-date source repos which you can update with pod repo update.
mistyped the name or version.
not added the source repo that hosts the Podspec to your Podfile.
Note: as of CocoaPods 1.0, pod repo update does not happen on pod install by default.
[!] Your Podfile has had smart quotes sanitised. To avoid issues in the future, you should not use TextEdit for editing it. If you are not using TextEdit, you should turn off smart quotes in your editor of choice.
I have said in the pod file - pod 'Firebase' and that is installing fine, but I don't know why 'Firebase/Auth' isn't installing.
This is using swift and Xcode is any of you were wondering, please can someone suggest what I can do to solve this, thanks
This is the pod file:
platform: ios, '8.0'
use_frameworks!
target: 'Lifelapse' do
pod 'Canvas'
pod 'Firebase'
pod 'Firebase/Auth'
end
EDIT:
The solution was just to 'pod repo update' which worked perfectly. However now I have 27 error messages - Please help!
I did more or less than the guy told us
but my steps were a little different:
On the Terminal: go to your project folder:
1.1 sudo Desktop/YourApp
1.2 YOURMAC:YourApp Fernanda$ sudo pod init
Change your file Podfile to:
# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
target 'YourApp' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for YourApp
pod 'Firebase'
end
On the Terminal: pod install
Now, change your file Podfile again to:
# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
target 'YourApp' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for YourApp
pod 'Firebase'
pod 'Firebase/Auth'
end
On the Terminal: pod update
try update platform version 8.0 to 9.0
platform: ios, '9.0'
use_frameworks!
target: 'Lifelapse' do
pod 'Canvas'
pod 'Firebase'
pod 'Firebase/Auth'
end
I'm recently learn iOS and I want to install the GoogleMap SDK for iOS in my project.
But when I installed with pod install it got an error say that the 'GoogleMaps' doesn't have concrete dependency ... or some thing like that.
I did as the instruction on the GoogleMapsAPI web source and this is my Podfile
'https://github.com/CocoaPods/Specs.git'
pod 'GoogleMaps'
Please tell me where do I did wrong. Thanks
You have to specify a target for each pod.
e.g. if before you had your Podfile written like this:
pod 'GoogleMaps'
just change it to
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.1'
target "TargetName" do
pod 'GoogleMaps'
end
When you are working with latest pod you need to write Target in Pod file
Like below.
Currently your pod file looking like
pod "YOUR_POD"
Change To
target "Your_Target_Name" do
pod "YOUR_POD"
end
I want to integrate "Login with google" in my application. I tried to use pods, but i am getting error which is as follows:
The 'Pods-ProjectName' target has transitive dependencies that include static binaries: ProjectPath/GoogleAppUtilities/Libraries/libOpenInChrome.a
My Pod file code is as follows:
target 'ProjectName' do
use_frameworks!
pod "OAuthSwift", "~> 0.3.4"
pod "Haneke", "~> 1.0"
pod "Alamofire", "~> 1.2"
pod "IJReachability", :git => "https://github.com/Isuru-Nanayakkara/IJReachability.git"
pod "iCarousel"
pod 'SDWebImage', '~>3.7'
pod 'Google/SignIn'
end
I am using Crashlytics also. Without Google/signIn i am able to create pods workspace successfully.
Any solution on this.
Regarding cocoapods documentation for version 0.36, you can not add static libraries to your project. Google pod seems to have dependencies to some static libraries making pod install crash.
If you use ObjectiveC, and you remove the use_frameworks! part, you will have no problem.
Another option, of course, is to add the Google lib directly to the project so you won't be using cocoapods.
Add the following lines of code to your pod file to ignore transitive dependencies:
pre_install do |installer|
def installer.verify_no_static_framework_transitive_dependencies
end
end
If you're using podfile like MIHCrypto uses static libraries added all dependency libraries to project and change mach-O-Type to static as per below:
Go to your podfile and insert the following
pre_install do |installer|
def installer.verify_no_static_framework_transitive_dependencies; end
end
This worked for me.