Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cocoapods dependency issue #3985

Closed
tosbaha opened this issue Aug 8, 2015 · 23 comments
Closed

Cocoapods dependency issue #3985

tosbaha opened this issue Aug 8, 2015 · 23 comments

Comments

@tosbaha
Copy link

@tosbaha tosbaha commented Aug 8, 2015

I am trying to create a Cocoapods library. My library will include Google-Mobile-Ads-SDK as dependency. I used following commands

pod lib create BannerViewController
 > my email address
What language do you want to use?? [ ObjC / Swift ]
 > Swift
Would you like to include a demo application with your library? [ Yes / No ]
 > Yes
Which testing frameworks will you use? [ Quick / None ]
 > None
Would you like to do view based testing? [ Yes / No ]
 > No  

then edited BannerViewController.podspec added following line

s.dependency 'Google-Mobile-Ads-SDK', '~> 7.0'

I tried to use pod lib lint BannerViewController.podspec

[!] BannerViewController did not pass validation, due to 1 error and 3 warnings.
You can use the `--no-clean` option to inspect any issue.

I tried to pod update in Example directory and got following error

[!] The 'Pods-BannerViewController_Example' target has transitive dependencies that include static binaries: (/Developer/BannerViewController/Example/Pods/Google-Mobile-Ads-SDK/GoogleMobileAdsSdkiOS-7.4.0/GoogleMobileAds.framework)

I don't know how can I add Google-Mobile-Ads-SDK to my development pod so that I can test my code locally. Cocoapods documentation is not clear. I am using Cocoapods 0.38.2

@segiddins

This comment has been minimized.

Copy link
Member

@segiddins segiddins commented Aug 8, 2015

You have to integrate as a static library until google ships a dynamic framework for their pod.

@segiddins segiddins closed this Aug 9, 2015
@tosbaha

This comment has been minimized.

Copy link
Author

@tosbaha tosbaha commented Aug 9, 2015

Could you share the details of this process? I asked on SO as well but I didn't get any reply. I will really appreciate if you can direct me to web page that details how to include Google-Moblie-Ads-SDK. For example Google ads can be integrated easily by pod and using objc header file. Isn't there a way to integrate ad sdk to my developer project same way so that I can work on it test it and publish? I know this is not a support forum but as I said I am run out of options.

@segiddins

This comment has been minimized.

Copy link
Member

@segiddins segiddins commented Aug 9, 2015

Don't use use_frameworks! in your Podfile, and lint using the ---use-libraries flag.

@tosbaha

This comment has been minimized.

Copy link
Author

@tosbaha tosbaha commented Sep 1, 2015

Sorry for opening this issue again. I just gave it a go today again. Still it doesn't work. I removed use_frameworks! and tried to lint it with pod lib lint --use-libraries I get again the samer error message Here are my files

BannerViewController.podspec

Pod::Spec.new do |s|
  s.name             = "BannerViewController"
  s.version          = "0.1.0"
  s.summary          = "A short description of BannerViewController."

# This description is used to generate tags and improve search results.
#   * Think: What does it do? Why did you write it? What is the focus?
#   * Try to keep it short, snappy and to the point.
#   * Write the description between the DESC delimiters below.
#   * Finally, don't worry about the indent, CocoaPods strips it!  
  s.description      = <<-DESC
                          Some long description
                       DESC

  s.homepage         = "https://github.com/tosbaha/BannerViewController"
  # s.screenshots     = "www.example.com/screenshots_1", "www.example.com/screenshots_2"
  s.license          = 'MIT'
  s.author           = { "tosbaha" => "email@address.com" }
  s.source           = { :git => "https://github.com/tosbaha/BannerViewController.git", :tag => s.version.to_s }
  # s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'

  s.platform     = :ios, '7.0'
  s.requires_arc = true

  s.source_files = 'Pod/Classes/**/*'
  s.resource_bundles = {
    'BannerViewController' => ['Pod/Assets/*.png']
  }
  s.dependency 'Google-Mobile-Ads-SDK', '~> 7.0'
end

Podfile

source 'https://github.com/CocoaPods/Specs.git'

target 'BannerViewController_Example', :exclusive => true do
  pod "BannerViewController", :path => "../"
end

target 'BannerViewController_Tests', :exclusive => true do
  pod "BannerViewController", :path => "../"


end
@segiddins

This comment has been minimized.

Copy link
Member

@segiddins segiddins commented Sep 1, 2015

Can you please share the output of pod lib lint --use-libraries --verbose? Thanks!

@tosbaha

This comment has been minimized.

Copy link
Author

@tosbaha tosbaha commented Sep 1, 2015

Here is the output

    BannerViewController (0.1.0) - Analyzing on iOS 7.0 platform.
  Preparing

Analyzing dependencies

Fetching external sources
-> Fetching podspec for `BannerViewController` from `/Developer/BannerViewController/BannerViewController`

Resolving dependencies of 

Comparing resolved specification to the sandbox manifest
  A BannerViewController
  A Google-Mobile-Ads-SDK

Downloading dependencies

-> Installing BannerViewController (0.1.0)

-> Installing Google-Mobile-Ads-SDK (7.4.1)
  > Copying Google-Mobile-Ads-SDK from
  `/Users/mustafa/Library/Caches/CocoaPods/Pods/Release/Google-Mobile-Ads-SDK/7.4.1-dce4c` to
  `../../../private/var/folders/l6/kbswrgr55vb7pj79r5t1_s5m0000gn/T/CocoaPods/Lint/Pods/Google-Mobile-Ads-SDK`
  - Running pre install hooks
 -> BannerViewController (0.1.0)
    - WARN  | summary: The summary is not meaningful.
    - WARN  | description: The description is shorter than the summary.
    - WARN  | url: There was a problem validating the URL https://github.com/<GITHUB_USERNAME>/BannerViewController.
    - ERROR | [iOS] unknown: Encountered an unknown 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 Pod being used is: BannerViewController) during validation.

[!] BannerViewController did not pass validation, due to 1 error and 3 warnings.
You can use the `--no-clean` option to inspect any issue.

/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.3/lib/cocoapods/command/lib.rb:181:in `block in run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.3/lib/cocoapods/command/lib.rb:153:in `each'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.3/lib/cocoapods/command/lib.rb:153:in `run'
/Library/Ruby/Gems/2.0.0/gems/claide-0.9.1/lib/claide/command.rb:312:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.3/lib/cocoapods/command.rb:48:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0.beta.3/bin/pod:44:in `<top (required)>'
/usr/bin/pod:23:in `load'
/usr/bin/pod:23:in `<main>'
@segiddins

This comment has been minimized.

Copy link
Member

@segiddins segiddins commented Sep 1, 2015

- ERROR | [iOS] unknown: Encountered an unknown 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 Pod being used is: BannerViewController) during validation.
@tosbaha

This comment has been minimized.

Copy link
Author

@tosbaha tosbaha commented Sep 1, 2015

You said don't use use_frameworks! That is why I removed it from Podfile. I am really puzzled. So it means there is no way to use cocoapods to integrate Google-Mobile-Ads-SDK to my swift library?

@segiddins

This comment has been minimized.

Copy link
Member

@segiddins segiddins commented Sep 1, 2015

Ask Google to update to ship dynamic frameworks ¯_(ツ)_/¯

@Lucashuang0802

This comment has been minimized.

Copy link

@Lucashuang0802 Lucashuang0802 commented Apr 20, 2016

Do we have a solution for this problem? So, we can't use a static library as a dependency to develop framework?

@orta

This comment has been minimized.

Copy link
Member

@orta orta commented Apr 21, 2016

No, this is a LLVM / iOS issue, not a CocoaPods one.

@nicorsm

This comment has been minimized.

Copy link

@nicorsm nicorsm commented Apr 21, 2016

I'm following. I have the same issue with Google SignIn iOS library. This is the error from pod spec lint:

- ERROR | [iOS] unknown: Encountered an unknown error (The 'Pods' target has transitive dependencies that include static binaries: (/private/var/folders/1_/7bxg_52x3rg89wmdqy6fnkrc0000gn/T/CocoaPods/Lint/Pods/Google/Libraries/libGGLCore.a and /private/var/folders/1_/7bxg_52x3rg89wmdqy6fnkrc0000gn/T/CocoaPods/Lint/Pods/Google/Libraries/libGGLSignIn.a)) during validation.

@kunalbalani

This comment has been minimized.

Copy link

@kunalbalani kunalbalani commented May 23, 2016

I have the same problem :(

@Lucashuang0802

This comment has been minimized.

Copy link

@Lucashuang0802 Lucashuang0802 commented May 23, 2016

@kunalbalani use --use-libraries when you validate or submit to CocoaPods. And if you do it this way, you users can use use_frameworks! in Podfile.

@kunalbalani

This comment has been minimized.

Copy link

@kunalbalani kunalbalani commented May 23, 2016

@Lucashuang0802 that worked. Thanks 👍

@wilddylan

This comment has been minimized.

Copy link

@wilddylan wilddylan commented Nov 3, 2016

Hi, same issue. use use_frameworks! in your Podfile, do not use --use-libraries when lint.

@ElizaSapir

This comment has been minimized.

Copy link

@ElizaSapir ElizaSapir commented Jan 7, 2017

Hey,

I have the same issue,

    - ERROR | [iOS] unknown: Encountered an unknown error (The 'Pods-App' target has transitive dependencies that include static binaries: (/private/var/folders/57/pv4_gcjx5pn3_0vht648bqsm0000gn/T/CocoaPods/Lint/Pods/GoogleAds-IMA-iOS-SDK/GoogleInteractiveMediaAds/GoogleInteractiveMediaAds-GoogleIMA3/GoogleInteractiveMediaAds.framework)) during validation.

tried --use-libraries it doesn't help.

can you give me a solution? for now below is my code from podspec:


s.subspec 'IMAPlugin' do |ssp|
    ssp.source_files = 'Plugins/IMA'
    ssp.xcconfig = { 'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES',
                  'OTHER_LDFLAGS' => '$(inherited) -framework "GoogleInteractiveMediaAds"',
                  'FRAMEWORK_SEARCH_PATHS' => '$(inherited) "${PODS_ROOT}"/**',
                  'LIBRARY_SEARCH_PATHS' => '$(inherited) "${PODS_ROOT}"/**' }
    ssp.dependency 'GoogleAds-IMA-iOS-SDK', '~> 3.3'
end

Pod install works but lint doesnt work for me, how can i handle it?

Thanks!

to:
@tosbaha , @segiddins , @orta , @Lucashuang0802 , @nicorsm

@trein

This comment has been minimized.

Copy link

@trein trein commented Dec 30, 2017

Hi. Is there any workaround for this issue? It has been more than one year and I'm wondering if there is something else people haven't tried yet.

@paulb777

This comment has been minimized.

Copy link
Member

@paulb777 paulb777 commented Dec 31, 2017

The CocoaPods static_framework introduced in 1.4.0 enables pods to depend on static library framework CocoaPods like Google-Mobile-Ads-SDK.

@wuzeqin

This comment has been minimized.

Copy link

@wuzeqin wuzeqin commented Mar 9, 2018

if these method still solve your problem ,try to clean your local CocoaPods cache(remove file xx/Library/Caches/CocoaPods/Pods)

@ZeRoB

This comment has been minimized.

Copy link

@ZeRoB ZeRoB commented Mar 27, 2018

In the .podspec file, above the line:
s.dependency ...
Add:
s.static_framework = true

when using CocoaPods version 1.4.0 and above and everything should work fine!

@ravisankar-r

This comment has been minimized.

Copy link

@ravisankar-r ravisankar-r commented Jul 1, 2018

Hi, adding s.static_framework = true worked for me. But can someone explain how that works, not clear on what that flag does. Thank you

@paulb777

This comment has been minimized.

Copy link
Member

@paulb777 paulb777 commented Jul 1, 2018

@ravika08 See the Static Frameworks section in the CocoaPods 1.4.0 announcement blog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.