0

My flutter app was running well even with Xcode 13.2.1. After making some changes to the code, I tried to build it with iOS. It's building alright. But when I try to Archive the project for Testflight I am having the following error.

Multiple commands produce '/Users/mdhasanrahman/Library/Developer/Xcode/DerivedData/Runner-fgzktmibyndpbgfkmsizqhgncvxe/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Reachability.framework':

  1. Target 'Reachability' has create directory command with output '/Users/mdhasanrahman/Library/Developer/Xcode/DerivedData/Runner-fgzktmibyndpbgfkmsizqhgncvxe/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Reachability.framework'
  2. Target 'ReachabilitySwift' has create directory command with output '/Users/mdhasanrahman/Library/Developer/Xcode/DerivedData/Runner-fgzktmibyndpbgfkmsizqhgncvxe/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Reachability.framework'

There is also a Target Integrity issue.

Multiple targets match implicit dependency for linker flags '-framework Reachability'. Consider adding an explicit dependency on the intended target to resolve this ambiguity. (in target 'Runner' from project 'Runner')

Target 'Reachability' (in project 'Pods')

Target 'ReachabilitySwift' (in project 'Pods')

I have tried all the solutions I could fing over the last 4 days. Still no luck. I am currently on Flutter (Channel master, 2.11.0-0.0.pre.450, on macOS 12.1) with M1 Max processor. Following is the Podfile

# 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'

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

Hasan Sawan
  • 391
  • 2
  • 14
  • Now I have magnified the issue. The issue is with flutter_offline library. – Hasan Sawan Feb 06 '22 at 01:59
  • I have raised an issue https://github.com/jogboms/flutter_offline/issues/48 – Hasan Sawan Feb 06 '22 at 02:21
  • We dont have the flutter offline library still getting the same error with reachability framework, Please let us know if you got any updates on this. – urjit on rails Feb 11 '22 at 13:52
  • there must be one library which use the connectivity library as it's own dependency. sadly, the only solution is to go back to the last stable build and check which library you have used that has triggered the issue? – Hasan Sawan Feb 17 '22 at 12:54

2 Answers2

3

You have added more than one connectivity plugins in your pubspec.yaml file. Please remove all of the other plugins and put only one.

Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
Bhavy5145
  • 46
  • 1
0

searched for the dependency that uses the package in Podfile.lock, In my case it was the keyboard_visibility package that was causing the problem.