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

The 'Pods-Runner' target has transitive dependencies #14161

Open
aloisdeniel opened this Issue Jan 18, 2018 · 10 comments

Comments

Projects
None yet
8 participants
@aloisdeniel
Copy link

aloisdeniel commented Jan 18, 2018

Steps to Reproduce

Install my appcenter plugin and add initialisation code in your app :

  @override
  initState() {
    super.initState();
    initPlatformState();
  }

  Future initPlatformState() async {
    await AppCenter.start("<_app_secret>");
  }

The code works well with the local example generated with the plugin project template, but when installing with the dart package its doesn't work : I get the following error.

The 'Pods-Runner' target has transitive dependencies that include static binaries:  ...

I first saw that in the local example project, the Podfile doesn't have the use_frameworks! command, so I removed it. But it fails too and the library doesn't seem to be present.

Logs

Before removing use_framework! from Podfile :

      - Running pre install hooks
    [!] The 'Pods-Runner' target has transitive dependencies that include static binaries: (/Users/alois/flutter_orange/src/ios/Pods/AppCenter/AppCenter-SDK-Apple/iOS/AppCenterAnalytics.framework, /Users/alois/flutter_orange/src/ios/Pods/AppCenter/AppCenter-SDK-Apple/iOS/AppCenter.framework, and /Users/alois/flutter_orange/src/ios/Pods/AppCenter/AppCenter-SDK-Apple/iOS/AppCenterCrashes.framework)
    
    /usr/local/Cellar/cocoapods/1.3.1/libexec/gems/cocoapods-1.3.1/lib/cocoapods/installer/xcode/target_validator.rb:81:in `block (2 levels) in verify_no_static_framework_transitive_dependencies'
    /usr/local/Cellar/cocoapods/1.3.1/libexec/gems/cocoapods-1.3.1/lib/cocoapods/installer/xcode/target_validator.rb:73:in `each'
    /usr/local/Cellar/cocoapods/1.3.1/libexec/gems/cocoapods-1.3.1/lib/cocoapods/installer/xcode/target_validator.rb:73:in `block in verify_no_static_framework_transitive_dependencies'
    /usr/local/Cellar/cocoapods/1.3.1/libexec/gems/cocoapods-1.3.1/lib/cocoapods/installer/xcode/target_validator.rb:70:in `each'
    /usr/local/Cellar/cocoapods/1.3.1/libexec/gems/cocoapods-1.3.1/lib/cocoapods/installer/xcode/target_validator.rb:70:in `verify_no_static_framework_transitive_dependencies'
    /usr/local/Cellar/cocoapods/1.3.1/libexec/gems/cocoapods-1.3.1/lib/cocoapods/installer/xcode/target_validator.rb:36:in `validate!'
    /usr/local/Cellar/cocoapods/1.3.1/libexec/gems/cocoapods-1.3.1/lib/cocoapods/installer.rb:405:in `validate_targets'
    /usr/local/Cellar/cocoapods/1.3.1/libexec/gems/cocoapods-1.3.1/lib/cocoapods/installer.rb:118:in `install!'
    /usr/local/Cellar/cocoapods/1.3.1/libexec/gems/cocoapods-1.3.1/lib/cocoapods/command/install.rb:41:in `run'
    /usr/local/Cellar/cocoapods/1.3.1/libexec/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
    /usr/local/Cellar/cocoapods/1.3.1/libexec/gems/cocoapods-1.3.1/lib/cocoapods/command.rb:52:in `run'
    /usr/local/Cellar/cocoapods/1.3.1/libexec/gems/cocoapods-1.3.1/bin/pod:55:in `<top (required)>'
    /usr/local/Cellar/cocoapods/1.3.1/libexec/bin/pod:22:in `load'
    /usr/local/Cellar/cocoapods/1.3.1/libexec/bin/pod:22:in `<main>'
Error running pod install

After removing use_framework! from Podfile :

	0   CoreFoundation                      0x000000010c27812b __exceptionPreprocess + 171
	1   libobjc.A.dylib                     0x000000010b90cf41 objc_exception_throw + 48
	2   CoreFoundation                      0x000000010c2f9024 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
	3   CoreFoundation                      0x000000010c1faf78 ___forwarding___ + 1432
	4   CoreFoundation                      0x000000010c1fa958 _CF_forwarding_prep_0 + 120
	5   Runner                              0x000000010744d972 -[MSAppCenter configure:] + 208
	6   Runner                              0x000000010744dc84 -[MSAppCenter start:withServices:] + 108
	7   Runner                              0x000000010744d1e7 +[MSAppCenter start:withServices:] + 95
	8   Runner                              0x000000010744a0df -[AppcenterPlugin<…>
@aloisdeniel

This comment has been minimized.

Copy link
Author

aloisdeniel commented Jan 18, 2018

Okay, after further investigation I now know why the sample project works, and not my actual project that depends on it through Pub.

When generating a plugin template, the generated example Runner project was based on Objective-C :

image

However the project I then created from Intellij is based on Swift :

image

So the use_frameworks! directive makes senses in my Swift project, but why doesn't it achieve to reference the various transitive pods ?

@aloisdeniel

This comment has been minimized.

Copy link
Author

aloisdeniel commented Jan 18, 2018

I also compared the AppCenter plugin to the Firebase plugin that are both implemented in Objective-C, with a dependency to a pod implemented in Objective-C.

The only potential difference I see in Firebase/Core podspec, compared to AppCenter podspec that could be a problem is the s.static_framework = true directive.

@Hixie

This comment has been minimized.

Copy link
Contributor

Hixie commented May 24, 2018

@xster

This comment has been minimized.

Copy link
Contributor

xster commented May 24, 2018

cc @mravn-google and @collinjackson who might have more insights.

@mravn-google

This comment has been minimized.

Copy link
Contributor

mravn-google commented May 24, 2018

@aloisdeniel We do seem to need s.static_framework = true in podspecs when Swift is involved in the app and using CocoaPods 1.5.0 or later.

@gerryhigh

This comment has been minimized.

Copy link

gerryhigh commented May 25, 2018

FYI - I ran into this issue just yesterday when running my app on iOS for the first time in a while after having added in the google_map_flutter plugin. It turns out the fix was to replace my ios/Podfile with a newer one (I pulled the one from the google maps example). I believe mine was generated a few months ago when I started this project--I can't remember. In comparing it to the google maps flutter example Podfile there were quite a few differences and so it was easiest to just replace it.

From this commit (flutter/plugins@20f9e7a ) I see that there is some work to clean up Podfiles in the plugins repo to make sure the latest is always used.

@mravn-google

@xster

This comment has been minimized.

Copy link
Contributor

xster commented May 25, 2018

related #12573

@jmrboosties

This comment has been minimized.

Copy link

jmrboosties commented Jun 2, 2018

Ran into this problem, versioned down to cocoapods 1.4.0 and it resolved. Of course I'm running into another pod issue right now, but it's unrelated to this...

@RaduGrama

This comment has been minimized.

Copy link

RaduGrama commented Aug 16, 2018

@mravn-google, can you comment on your earlier statement "We do seem to need s.static_framework = true in podspecs when Swift is involved in the app and using CocoaPods 1.5.0 or later." please. Is that a "do need", "do not need", "maybe need"? This issue is still open...

@mravn-google

This comment has been minimized.

Copy link
Contributor

mravn-google commented Aug 16, 2018

@RaduGrama As far as I know, we do need that declaration, see

https://blog.cocoapods.org/CocoaPods-1.4.0/#static-frameworks

It is used 14 times in the flutter/plugins repo to deal with transitive dependencies on static binaries.

dlutton added a commit to dlutton/flutter_twitter_login that referenced this issue Sep 17, 2018

adding static_framework set to true
this is required for transitive dependencies.
flutter/flutter#14161

@mvanbeusekom mvanbeusekom referenced this issue Oct 3, 2018

Closed

Doesn't build without !use_framework #120

0 of 1 task complete

Sh1d0w added a commit to Sh1d0w/multi_image_picker that referenced this issue Nov 19, 2018

nohtaray added a commit to nohtaray/flutter_twitter_login that referenced this issue Jan 4, 2019

adding static_framework set to true
this is required for transitive dependencies.
flutter/flutter#14161

mitsutaka-takeda pushed a commit to mitsutaka-takeda/flutter_card_io that referenced this issue Jan 9, 2019

@zoechi zoechi added the t: xcode label Jan 30, 2019

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