Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Error (Xcode): Multiple commands produce #996

Closed
2 of 3 tasks
Ghaithmeftah opened this issue Feb 10, 2025 · 1 comment
Closed
2 of 3 tasks

[Bug]: Error (Xcode): Multiple commands produce #996

Ghaithmeftah opened this issue Feb 10, 2025 · 1 comment

Comments

@Ghaithmeftah
Copy link

Ghaithmeftah commented Feb 10, 2025

What happened?

Failed to build iOS app
Error (Xcode): Multiple commands produce
'/Users/user274560/Documents/soc_rugby/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/OneSignalFramework.framework'

Error (Xcode): Multiple commands produce
'/Users/user274560/Documents/soc_rugby/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/OneSignalExtension.framework'

Error (Xcode): Multiple commands produce
'/Users/user274560/Documents/soc_rugby/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/OneSignalNotifications.framework'

Error (Xcode): Multiple commands produce
'/Users/user274560/Documents/soc_rugby/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/OneSignalLiveActivities.framework'

Error (Xcode): Multiple commands produce
'/Users/user274560/Documents/soc_rugby/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/OneSignalOSCore.framework'

Error (Xcode): Multiple commands produce
'/Users/user274560/Documents/soc_rugby/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/OneSignalOutcomes.framework'

Error (Xcode): Multiple commands produce
'/Users/user274560/Documents/soc_rugby/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/OneSignalCore.framework'

Error (Xcode): Multiple commands produce
'/Users/user274560/Documents/soc_rugby/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/OneSignalUser.framework'

Error (Xcode): Multiple commands produce
'/Users/user274560/Documents/soc_rugby/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/OneSignalInAppMessages.framework'

Steps to reproduce?

1. added the OneSignal extension by following the OneSignal documentation
2. had the podfile with this code : need for another package # 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!
  
  #pod 'IosAwnCore', '~> 0.10.0'
  #pod 'IosAwnCore', :path => '../../../IosAwnCore/'
  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
        if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] == '8.0'
          config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
        end
    end
    flutter_additional_ios_build_settings target
  end

  ################  Awesome Notifications pod modification 1  ###################
  awesome_pod_file = File.expand_path(File.join('plugins', 'awesome_notifications', 'ios', 'Scripts', 'AwesomePodFile'), '.symlinks')
  require awesome_pod_file
  update_awesome_pod_build_settings(installer)
  ################  Awesome Notifications pod modification 1  ###################
end

################  Awesome Notifications pod modification 2  ###################
awesome_pod_file = File.expand_path(File.join('plugins', 'awesome_notifications', 'ios', 'Scripts', 'AwesomePodFile'), '.symlinks')
require awesome_pod_file
update_awesome_main_target_settings('Runner', File.dirname(File.realpath(__FILE__)), flutter_root)
################  Awesome Notifications pod modification 2  ################### 
3. did flutter run and boom error produced

What did you expect to happen?

the project to build successfuly

OneSignal Flutter SDK version

3.27.4

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

Launching lib/main.dart on iPhone 16 in debug mode...
Running Xcode build...                                                  
Xcode build done.                                           17.5s
Failed to build iOS app
Error (Xcode): Multiple commands produce
'/Users/user274560/Documents/soc_rugby/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/OneSignalFramework.framework'


Error (Xcode): Multiple commands produce
'/Users/user274560/Documents/soc_rugby/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/OneSignalExtension.framework'


Error (Xcode): Multiple commands produce
'/Users/user274560/Documents/soc_rugby/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/OneSignalNotifications.framework'


Error (Xcode): Multiple commands produce
'/Users/user274560/Documents/soc_rugby/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/OneSignalLiveActivities.framework'


Error (Xcode): Multiple commands produce
'/Users/user274560/Documents/soc_rugby/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/OneSignalOSCore.framework'


Error (Xcode): Multiple commands produce
'/Users/user274560/Documents/soc_rugby/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/OneSignalOutcomes.framework'


Error (Xcode): Multiple commands produce
'/Users/user274560/Documents/soc_rugby/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/OneSignalCore.framework'


Error (Xcode): Multiple commands produce
'/Users/user274560/Documents/soc_rugby/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/OneSignalUser.framework'


Error (Xcode): Multiple commands produce
'/Users/user274560/Documents/soc_rugby/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/OneSignalInAppMessages.framework'


Could not build the application for the simulator.
Error launching application on iPhone 16.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@nan-li
Copy link
Contributor

nan-li commented Feb 11, 2025

Hi @Ghaithmeftah this issue is common for our Flutter developers.

Please check out this thread for any suggestions that may resolve the issue for you.

Please ping me to reopen if none of the suggestions work.

@nan-li nan-li closed this as completed Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants