20

I am getting this error while running pod install

[!] The 'Pods-Runner' target has transitive dependencies that include static binaries: (/Users/me/Documents/flutter/flutter/bin/cache/artifacts/engine/ios/Flutter.framework)

After doing bit of a research it says use frameworks! in my Podfile is causing the issue. If I comment out use frameworks! I get this error. Any idea on what the issue is? I have been stuck here for the past three days.

ld: framework not found Flutter
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Also according to whats written here. Adding the following to Podfile also didn't work for me. This is how my Podfile looks.

# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

def parse_KV_file(file,seperator='=')
  file_abs_path = File.expand_path(file)
  if !File.exists? file_abs_path
    return [];
  end
  pods_ary = []
  skip_line_start_symbols = ["#", "/"]
  File.foreach(file_abs_path) { |line|
      next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
      plugin = line.split(pattern=seperator)
      if plugin.length == 2
        podname = plugin[0].strip()
        path = plugin[1].strip()
        podpath = File.expand_path("#{path}", file_abs_path)
        pods_ary.push({:name => podname,:path=>podpath});
      else
        puts "Invalid plugin specification: #{line}"
      end
  }
  return pods_ary
end

target 'Runner' do
  # Flutter Pods
  #use_frameworks!

  pod 'EstimoteSDK'
  pod 'SwiftKeychainWrapper'
  pod 'Alamofire'

  generated_xcode_build_settings = parse_KV_file("./Flutter/Generated.xcconfig")
  if generated_xcode_build_settings.empty?
    puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter build or flutter run is executed once first."
  end
  generated_xcode_build_settings.map{ |p|
    if p[:name]=='FLUTTER_FRAMEWORK_DIR'
      pod 'Flutter', :path => p[:path]
    end
  }

  # Plugin Pods
  plugin_pods = parse_KV_file("../.flutter-plugins")
  plugin_pods.map{ |p|
    pod p[:name], :path => File.expand_path("ios",p[:path])
  }
end

pre_install do |installer|
      # workaround for https://github.com/CocoaPods/CocoaPods/issues/3289
      Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end
Chaythanya Nair
  • 4,774
  • 6
  • 32
  • 40

10 Answers10

46

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

Tugay Yaldız
  • 641
  • 7
  • 11
13

Delete ios/Flutter/Flutter.framework folder.

Install pods again then it worked. It will regenerate the deleted folder

pod install

K K
  • 952
  • 9
  • 25
Talha Rasool
  • 1,126
  • 14
  • 12
8

In my case I don't have Flutter.framework, so the following solution worked for me

Inside the Podfile use_frameworks! :linkage => :static

Abdulrahman Alhayek
  • 1,626
  • 2
  • 15
  • 20
5

This process solve it for me :

  1. Delete ios/Flutter/Flutter.framework folder.
  2. Delete ios/PodFile
  3. Delete ios/PodFile.lock
  4. Go to the project root and re-save the file pubspec.yaml (on VSCode, this will automatically runs the following command : flutter get pub)
  5. Run the project again

Let me know if it works for you too

Nehemie KOFFI
  • 1,159
  • 12
  • 11
3

A complete reinstallation of flutter works for me.

Chaythanya Nair
  • 4,774
  • 6
  • 32
  • 40
Ernesto Campohermoso
  • 7,213
  • 1
  • 40
  • 51
3

Delete ios/Flutter/Flutter.framework folder. Install pods again then it worked. It will regenerate the deleted folder pod install

Christopher Moore
  • 15,626
  • 10
  • 42
  • 52
Hubert IT
  • 31
  • 1
2

In your podfile where You see

target 'Runner' do use_frameworks!
comment user_frameworks!

target 'Runner' do comment below line

use_frameworks!
and go to path /ios of the project

run

pod install

Mir Mahfuz
  • 663
  • 4
  • 9
1

what worked for me is

  • deleted the ios/Flutter/Flutter.framework folder
  • ran flutter create -i swift --org com.orgname .
  • I was able to run the app without pod install (after this procedure)
Yadu
  • 2,979
  • 2
  • 12
  • 27
0

Please check the ios/project.pbxproj. I was moved project to another folder and I forgot to replace the FLUTTER_TARGET and FLUTTER_APPLICATION_PATH with the newest one in the ios/project.pbxproj.

Akif
  • 7,098
  • 7
  • 27
  • 53
0

Commenting out use_frameworks! in the podfile, worked in my case.

desu sai venkat
  • 275
  • 3
  • 10