ios - 多个命令产生抖动 GoogleUtilities

标签 ios flutter build apple-push-notifications

我正在尝试为应用商店构建。使用命令 flutter build ipa并低于错误。尽管构建在 Debug模式下工作(当我从 Android Studio 运行时)并且我可以收到推送通知。

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

warning: Multiple targets match implicit dependency for linker flags '-framework GoogleUtilities'.Consider adding an explicit dependency on the intended target to
resolve this ambiguity. (in target 'ImageNotification' from project 'Runner')
error: Multiple commands produce

'/Users/manu/Library/Developer/Xcode/DerivedData/Runner-csuwafuzvneucvdjlkobmosdwxae/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuild
FilesPath/UninstalledProducts/iphoneos/GoogleUtilities.framework':
1) Target 'GoogleUtilities-00567490' has create directory command with output
'/Users/manu/Library/Developer/Xcode/DerivedData/Runner-csuwafuzvneucvdjlkobmosdwxae/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuild
FilesPath/UninstalledProducts/iphoneos/GoogleUtilities.framework'
2) Target 'GoogleUtilities-54e75ca4' has create directory command with output
'/Users/manu/Library/Developer/Xcode/DerivedData/Runner-csuwafuzvneucvdjlkobmosdwxae/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuild
FilesPath/UninstalledProducts/iphoneos/GoogleUtilities.framework'

note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description

我加了一个 ImageNotification推送通知中推送图像的新目标通知服务扩展
这是我的 pod 文件:
# Uncomment this line to define a global platform for your project
platform :ios, '14.3'

# 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 'ImageNotification' do
  use_frameworks!
  pod 'Firebase/Messaging'
end

最佳答案

ADD - Pod 'GoogleUtilities' 到 PodFile 中的 ImageNotification 目标和 Runner 目标。

target 'ImageNotification' do
  ...
  pod 'GoogleUtilities'
end

target 'Runner' do
  ...
  pod 'GoogleUtilities'
end
然后删除PodFile.lock然后运行flutter clean,然后flutter pub get,然后flutter build ios。
之后在 Xcode 中打开 ios 模块并构建存档。
它会起作用。

关于ios - 多个命令产生抖动 GoogleUtilities,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66645385/

相关文章:

ios - 在多个文本字段上填充

ios - Xcode codesign 想使用 "Apple Development"钥匙串(keychain)密码错误

ios - 使用特定动态类型尺寸的字体

ios - iOS11 中使用的 TLS 和 kCFStreamErrorCodeKey=-9800

ios - 如何使用 Objective-C 移动多个对象

django - 带有 Django 后端和谷歌身份验证的 Flutter 应用程序

flutter - 如何在 flutter 中单击清除按钮时清除整个表单

c - (automake, libtool) 在不同目录中使用相同的源文件名时,在 automake 中构建失败

c++ - Boost 构建 fatal error LNK1105

android - 52个 Unresolved 类和引用