2

I've got 2 Flutter projects, with the same:

  • Podfile
  • pubspec.yaml dependency list
  • Flutter version 3.3.7

One compiles, the other doesn't with the error:

 - Running pre install hooks
    [!] The 'Pods-Runner' target has transitive dependencies that include statically linked binaries:
    (/Users/daveshirman/Documents/Work/scy/ios/Pods/Mux-Stats-AVPlayer/XCFramework/MUXSDKStats.xcframework)

I've tried:

  • Reinstalling cocoapods (now at 1.11.3)
  • Deleting pods folder + ios/Flutter folder + pub get
  • flutter clean multiple times
  • Deleting Podfile.lock
  • pod repo update
  • etc

None of these are working. I've seen some suggestions to add extra commands to the Podfile to ignore the error, but that seems like a workaround, not a solution.

Seeing as my 2 projects are set up the same, they should both compile with the same Podfile.

So...Any ideas?

Note: Please don't mark this as a duplicate. I've seen other questions similar, but none referncing the same linked library and none of their solutions have worked for me thus far.

Here's my Podfile in case:

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

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

project 'Runner', {
  'Debug' => :debug,
  'Profile' => :release,
  'Release' => :release,
}

def flutter_root
  generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
  unless File.exist?(generated_xcode_build_settings_path)
    raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
  end

  File.foreach(generated_xcode_build_settings_path) do |line|
    matches = line.match(/FLUTTER_ROOT\=(.*)/)
    return matches[1].strip if matches
  end
  raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

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

target 'OneSignalNotificationServiceExtension' do
  use_frameworks!
  pod 'OneSignalXCFramework', '>= 3.4.3', '< 4.0'
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    
    flutter_additional_ios_build_settings(target)

    target.build_configurations.each do |config|

      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
     
      config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
        '$(inherited)',
         'PERMISSION_PHOTOS=1',
         'PERMISSION_MEDIA_LIBRARY=1',
      ]

    end
  end
end
Dave
  • 5,283
  • 7
  • 44
  • 66

0 Answers0