7

After upgrading to flutter version 1.17.4 when running flutter build ios I get following output:

[!] The 'Pods-Runner' target has transitive dependencies that include statically linked binaries: (.../ios/Flutter/Flutter.framework)

    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer/xcode/target_validator.rb:84:in `block (2 levels) in verify_no_static_framework_transitive_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer/xcode/target_validator.rb:74:in `each_key'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer/xcode/target_validator.rb:74:in `block in verify_no_static_framework_transitive_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer/xcode/target_validator.rb:73:in `each'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer/xcode/target_validator.rb:73:in `verify_no_static_framework_transitive_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer/xcode/target_validator.rb:38:in `validate!'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer.rb:590:in `validate_targets'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer.rb:158:in `install!'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/command/install.rb:52:in `run'
    /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/command.rb:52:in `run'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/bin/pod:55:in `<top (required)>'
    /usr/local/bin/pod:23:in `load'
    /usr/local/bin/pod:23:in `<main>'

Error running pod install

What I tried:

  1. Deleting ios/Flutter/Flutter.framework and running pod install as suggested here didn't help
  2. Adding s.static_framework = true to Flutter.podspec - no luck
  3. Deleting-recreating ios folder - no luck
  4. Commenting out use_frameworks! in Podfile - leads to errors in plugins like fatal error: '..._plugin-Swift.h' file not found
  5. I also tried to downgrade the flutter as I didn't have any problem with prev one. But running flutter version v1.17.2 resulted in error:
Error: ProcessException: Process exited abnormally:
error: unsupported sort specification 'creatordate'

I'm stuck with this.

Nimantha
  • 6,405
  • 6
  • 28
  • 69
AlexKost
  • 2,792
  • 4
  • 22
  • 42

3 Answers3

9

If this issue occured while you trying to implement your own flutter plugin, then simply add this line below dependencies to .podspec

s.static_framework = true 
6

I get same problem with this error output:

[!] The 'Pods-Runner' target has transitive dependencies that include statically linked binaries:
    (/.../ios/Flutter/Flutter.framework)

    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/xcode/target_validator.rb:84:in `block (2 levels) in
    verify_no_static_framework_transitive_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/xcode/target_validator.rb:74:in `each_key'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/xcode/target_validator.rb:74:in `block in verify_no_static_framework_transitive_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/xcode/target_validator.rb:73:in `each'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/xcode/target_validator.rb:73:in `verify_no_static_framework_transitive_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/xcode/target_validator.rb:38:in `validate!'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer.rb:595:in `validate_targets'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer.rb:162:in `install!'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/command/install.rb:52:in `run'
    /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/command.rb:52:in `run'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/bin/pod:55:in `<top (required)>'
    /usr/local/bin/pod:23:in `load'
    /usr/local/bin/pod:23:in `<main>'

I have solved problem with tried this step:

  1. Open your folder ios in your project and open Podfile and you will see code like this:
target 'Runner' do
  use_frameworks!
  use_modular_headers!

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
  end
end
  1. You can remove code use_frameworks! and use_modular_headers! and this is complete code:
target 'Runner' do
  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
  end
end
  1. If you have follow instruction you can save change file and hit flutter run

  2. This is complete output:

Running pod install...                                              3.1s
Running Xcode build...                                                  
 └─Compiling, linking and signing...                        28.0s
Xcode build done.                                           73.0s
Waiting for iPhone 12 Pro Max to report its views...                19ms
Syncing files to device iPhone 12 Pro Max...                     1,218ms

Flutter run key commands.
r Hot reload. 
R Hot restart.
h Repeat this help message.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).
An Observatory debugger and profiler on iPhone 12 Pro Max is available at: http://127.0.0.1:50854/VhaUEREqLb0=/
Nimantha
  • 6,405
  • 6
  • 28
  • 69
Anwar
  • 169
  • 3
  • 8
1

*Disclaimer:

  1. I'm quite new to programming & coding and Flutter is my first programming language. But having struggled with this for 3 days, I believe I have fixed my code. Hoping this helps. Please excuse if this doesn't make sense.
  2. Other Newbies reading this: Do this only if you have a backup of your script, and all of above solutions failed for you.*

Background

My problem occurred when I upgraded Xcode to 12.0.1. Got the same error:

The 'Pods-Runner' target has transitive dependencies that include statically linked binaries:

I believe in the upgrade process, some link in an unknown location broke between Flutter, Cocoa-pods & Xcode. I wasn't sure whether something broke internally within my project or within the platforms. Hence, I launched a new flutter project and confirmed it was the latter when that brand new project failed to launch on the Simulator.

Solution

My solution was to rejig the whole platform architecture, rather than re-writing the whole app code.

Step 1: Take a backup of your code (I didn't; got lucky or was just tired with the multiple iterations & backups.)

Step 2: Uninstalled Flutter (Restarted the Mac) and then Reinstalled Flutter on VSCODE

Step 3: Completely Uninstalled Cocoa-pods & Reinstalled Cocoapods. Followed the steps mentioned here.

[Now in your Project] Step 4: In the terminal, type 'flutter clean' to clean all caches pre-built for the project

Step 5: Delete (or Rename) '/ios' folder (to something else like '/111ios')

Step 6: Recreate a new /ios folder. In the terminal, type

flutter create -i swift

You might need to specify your root PWD for the command to build the ios folder in the right directory.

Step 7: Get packages

flutter pub get

Step 8: Flutter Run.

The above got my boat sailing again. Hopefully this helps the community!

T0rNaD0
  • 11
  • 1
  • 4