Flutter IOS 归档给出错误,“多个命令生成 GTMSessionFetcher_Core_Privacy.bundle”。 Xcode 15.4

问题描述 投票:0回答:2

错误:多个命令生成“/Users/user1/Library/Developer/Xcode/DerivedData/Runner-cccxxxxbxtrddshhkhjfkteujcckfyz/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GTMSessionFetcher_Core_Privacy.bundle” 注意:目标“GTMSessionFetcher-Core-GTMSessionFetcher_Core_Privacy”(项目“Pods”)具有带输出的创建目录命令'/Users/user1/Library/Developer/Xcode/DerivedData/Runner-cccxxxxbxtrddshhkhjfkteujcckfyz/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GTMSessionFetcher_Core_Privacy.bundle' 注意:目标“GTMSessionFetcher.default-Core-GTMSessionFetcher_Core_Privacy”(项目“Pods”)具有带输出的创建目录命令'/Users/user1/Library/Developer/Xcode/DerivedData/Runner-cccxxxxbxtrddshhkhjfkteujcckfyz/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GTMSessionFetcher_Core_Privacy.bundle'

错误:多个命令生成“/Users/user1/Library/Developer/Xcode/DerivedData/Runner-cccxxxxbxtrddshhkhjfkteujcckfyz/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GTMSessionFetcher.framework” 注意:目标“GTMSessionFetcher-Core”(项目“Pods”)具有带输出的创建目录命令'/Users/user1/Library/Developer/Xcode/DerivedData/Runner-cccxxxxbxtrddshhkhjfkteujcckfyz/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GTMSessionFetcher.framework' 注意:目标“GTMSessionFetcher.default-Core”(项目“Pods”)具有带输出的创建目录命令'/Users/user1/Library/Developer/Xcode/DerivedData/Runner-cccxxxxbxtrddshhkhjfkteujcckfyz/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GTMSessionFetcher.framework'

我尝试删除并更新 Pod。检查了在构建阶段复制捆绑资源,没有任何效果。

ios flutter xcode gtmsessionfetcher
2个回答
1
投票

三天后,我通过在 podfile 中的所有目标中添加 pod 'GTMSessionFetcher' 解决了这个问题。

目标“跑步者”做 使用框架! 使用模块化标题! pod 'GTMSessionFetcher'

flutter_install_all_ios_pods File.dirname(File.realpath(FILE)) 目标“RunnerTests”执行 继承! :搜索路径 结尾 结束

post_install |安装程序| installer.pods_project.targets.each 执行 |target| flutter_additional_ios_build_settings(目标) 结尾 结束

目标“ImageNotification” 使用框架! pod 'Firebase/Auth' pod 'Firebase/消息传递' pod 'GTMSessionFetcher' 结束


0
投票

当我必须修复 Firebase 错误并将其投入生产时,也遇到了类似的问题(孩子们,不要依赖 Firebase)

将部署目标从 13 升级到 14 以及 Auth 和 Messaging 等 Firebase 库后,开始发生类似的错误。通过将 GTMSessionFetcher 添加到 ImageNotification 目标来修复,并且我不必将其添加到 Runner

这是完整的 Podfile:

platform :ios, '14.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 'GoogleTagManager', :modular_headers => true
  pod 'Firebase', :modular_headers => true
  pod 'FirebaseCore', :modular_headers => true
  pod 'FirebaseCoreInternal', :modular_headers => true
  pod 'GoogleUtilities', :modular_headers => true

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

post_install do |installer|
  fix_deployment_target(installer)
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
    # Start of the permission_handler configuration
    target.build_configurations.each do |config|
      #  Preprocessor definitions can be found in: https://github.com/Baseflow/flutter-permission-handler/blob/master/permission_handler_apple/ios/Classes/PermissionHandlerEnums.h
      config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
        '$(inherited)',
  
        ## dart: PermissionGroup.calendar
        'PERMISSION_EVENTS=1',
  
        ## dart: PermissionGroup.reminders
        'PERMISSION_REMINDERS=1',
  
        ## dart: PermissionGroup.contacts
        'PERMISSION_CONTACTS=1',
  
        ## dart: PermissionGroup.camera
        # 'PERMISSION_CAMERA=1',
  
        ## dart: PermissionGroup.microphone
        # 'PERMISSION_MICROPHONE=1',
  
        ## dart: PermissionGroup.speech
        # 'PERMISSION_SPEECH_RECOGNIZER=1',
  
        ## dart: PermissionGroup.photos
        # 'PERMISSION_PHOTOS=1',
  
        ## dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse]
        'PERMISSION_LOCATION=1',
          
        ## dart: PermissionGroup.notification
        'PERMISSION_NOTIFICATIONS=1',
  
        ## dart: PermissionGroup.mediaLibrary
        # 'PERMISSION_MEDIA_LIBRARY=1',
  
        ## dart: PermissionGroup.sensors
        # 'PERMISSION_SENSORS=1',   
           
        ## dart: PermissionGroup.bluetooth
        # 'PERMISSION_BLUETOOTH=1',
   
        ## dart: PermissionGroup.appTrackingTransparency
        # 'PERMISSION_APP_TRACKING_TRANSPARENCY=1',
   
        ## dart: PermissionGroup.criticalAlerts
        # 'PERMISSION_CRITICAL_ALERTS=1'
      ]
  
    end 
    # End of the permission_handler configuration
  end
end

target 'ImageNotification' do
  use_frameworks!
  use_modular_headers!
  pod 'Firebase/Messaging', :modular_headers => true
  pod 'Firebase/Auth', :modular_headers => true
  pod 'GoogleUtilities', :modular_headers => true
  pod 'GTMSessionFetcher', :modular_headers => true
end

def fix_deployment_target(installer)
  return if !installer
  project = installer.pods_project
  project_deployment_target = project.build_configurations.first.build_settings['IPHONEOS_DEPLOYMENT_TARGET']

  puts "Make sure all pods deployment target is #{project_deployment_target.green}"
  project.targets.each do |target|
    puts "  #{target.name}".blue
    target.build_configurations.each do |config|
      old_target = config.build_settings['IPHONEOS_DEPLOYMENT_TARGET']
      new_target = project_deployment_target
      next if old_target == new_target
      puts "    #{config.name}: #{old_target.yellow} -> #{new_target.green}"
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = new_target
    end
  end
end
© www.soinside.com 2019 - 2024. All rights reserved.