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 · 15 comments
Open

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

aloisdeniel opened this issue Jan 18, 2018 · 15 comments
Labels
P3 Issues that are less important to the Flutter project platform-ios iOS applications specifically platform-mac Building on or for macOS specifically t: xcode "xcodebuild" on iOS and general Xcode project management team-ios Owned by iOS platform team tool Affects the "flutter" command-line tool. See also t: labels. triaged-ios Triaged by iOS platform team

Comments

@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
Copy link
Author

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
Copy link
Author

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 Hixie added platform-ios iOS applications specifically tool Affects the "flutter" command-line tool. See also t: labels. platform-mac Building on or for macOS specifically labels May 24, 2018
@Hixie Hixie added this to the Goals milestone May 24, 2018
@Hixie
Copy link
Contributor

Hixie commented May 24, 2018

cc @xster @cbracken

@xster
Copy link
Member

xster commented May 24, 2018

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

@mravn-google
Copy link
Contributor

@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
Copy link

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
Copy link
Member

xster commented May 25, 2018

related #12573

@jmrboosties
Copy link

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
Copy link

@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
Copy link
Contributor

@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
this is required for transitive dependencies.
flutter/flutter#14161
nohtaray added a commit to nohtaray/flutter_twitter_login that referenced this issue Jan 4, 2019
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 "xcodebuild" on iOS and general Xcode project management label Jan 30, 2019
andreidiaconu added a commit to andreidiaconu/flutter-zendesk that referenced this issue Jun 4, 2019
Proposed solution cames from flutter/flutter#14161
iecanfly added a commit to iecanfly/dalipush that referenced this issue Aug 21, 2019
The 'Pods-Runner' target has transitive dependencies
@jmagman jmagman added this to Awaiting triage in Tools - Xcode review Jan 10, 2020
@jmagman jmagman moved this from Awaiting triage to Engineer reviewed in Tools - Xcode review Jan 10, 2020
@TugayYaldiz
Copy link

For me, I deleted the ios/Flutter/Flutter.framework folder and install pods pod install again then it worked.

@franciscoantonello
Copy link

For me, I deleted the ios/Flutter/Flutter.framework folder and install pods pod install again then it worked.

It works...

@Alissonpcl
Copy link

For me, I deleted the ios/Flutter/Flutter.framework folder and install pods pod install again then it worked.

Worked for me too!

@marianoarga
Copy link

I dont quite understand whats the override for this to work, I'm not able to use 1.4.0 version of Cocoapods, my project requires at least 1.10.0

@jmagman
Copy link
Member

jmagman commented Aug 25, 2021

I thought this would be fixed by #70224, but users in duplicate #20045 claim it didn't.

LuckyBoy1004 added a commit to LuckyBoy1004/Crashlytics-Flutter that referenced this issue Jan 30, 2023
@flutter-triage-bot flutter-triage-bot bot added multiteam-retriage-candidate team-ios Owned by iOS platform team triaged-ios Triaged by iOS platform team labels Jul 8, 2023
@jmagman jmagman added P3 Issues that are less important to the Flutter project and removed P2 Important issues not at the top of the work list labels Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 Issues that are less important to the Flutter project platform-ios iOS applications specifically platform-mac Building on or for macOS specifically t: xcode "xcodebuild" on iOS and general Xcode project management team-ios Owned by iOS platform team tool Affects the "flutter" command-line tool. See also t: labels. triaged-ios Triaged by iOS platform team
Projects
Tools - Xcode review
  
Engineer reviewed
Development

No branches or pull requests