Issue
I did Flutter run , then I get this error message.
I did a lot of research. But no one had the same symptoms as me.
I have rewritten the podfile, flutter clean, pod update, etc., but I still get the same error.
Error code
Failed to build iOS app
Error (Xcode): Multiple commands produce
'{FilePath}/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libavcodec.framework'
Error (Xcode): Multiple commands produce
'{FilePath}build/ios/Debug-iphonesimulator/Runner.app/Frameworks/libswscale.framework'
Podfile
# Uncomment this line to define a global platform for your project
platform :ios, '13.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.generated_projects.each do |project|
project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
end
end
end
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
pubspec.yaml
name: x
description: A new Flutter project.
publish_to: "none" # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1
environment:
sdk: ">=2.19.2 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
flutter_staggered_grid_view: ^0.7.0
font_awesome_flutter: ^10.4.0
jiffy: ^6.1.0
carousel_slider: ^4.2.1
image_picker: ^1.0.1
path_provider: ^2.0.14
document_scanner_flutter: ^0.2.7
permission_handler: ^11.3.1
image_gallery_saver: ^2.0.3
ffmpeg_kit_flutter: ^6.0.3
fluttertoast: ^8.2.1
provider: ^6.0.5
media_scanner: ^2.1.0
share_plus: ^9.0.0
sqflite: ^2.2.6
flutter_launcher_icons: ^0.13.0
package_info_plus: ^8.0.0
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^4.0.0
flutter:
uses-material-design: true
assets:
- images/
What I tried that (didn’t work)
I have not tried many of the measures because I could not find any information on them in my research.
Sorry
- flutter clean
- cd ios && rm -rf podfile.lock , pod install
- add Xcode Framework