Google NearbyMessages cocoapod generates “duplicate output file” error

五迷三道 提交于 2019-12-11 16:59:33

问题


I’m having a problem with NearbyMessages in Xcode 11.2. When I add pod 'NearbyMessages' and then do pod install, when I open the xcworkspace, I get a “duplicate output file” error resulting from the Assets.car that is generated by “[CP] Copy Pods Resources” build phase:

warning: duplicate output file '/Users/.../DerivedData/NearbyDemo-elvzmjtrsxnstlemqnzociqoajhv/Build/Products/Debug-iphonesimulator/NearbyDemo.app/Assets.car' on task: PhaseScriptExecution [CP] Copy Pods Resources /Users/.../DerivedData/NearbyDemo-elvzmjtrsxnstlemqnzociqoajhv/Build/Intermediates.noindex/NearbyDemo.build/Debug-iphonesimulator/NearbyDemo.build/Script-EB8FCF95DAAD8AF429AAA51F.sh (in target 'NearbyDemo' from project 'NearbyDemo’)

I’ve searched and found old issues, e.g., Google Nearby Messages API Broke App Icon, that seem like they might be related. That post looks like it might be an earlier manifestation of the same problem with assets and NearbyMessages, but it looks like the old compiler may not have caught this error.

In Xcode 10.3, this is merely a warning:

ignoring duplicated output file: '/Users/.../DerivedData/NearbyDemo-elvzmjtrsxnstlemqnzociqoajhv/Build/Products/Debug-iphonesimulator/NearbyDemo.app/Assets.car' in shell script build phase '[CP] Copy Pods Resources'. This warning represents an extremely serious project misconfiguration and will likely cause some shell scripts in your project to be skipped entirely, leading to other build failures or missing files in the build directory. This will be a hard error in the future. (in target 'NearbyDemo’)

Does anyone know of anyway to resolve this? I can downgrade Xcode, probably letting this problem pass without a hard error, but that’s not a terribly appealing solution.


It probably isn’t relevant, but here’s my Podfile:

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'NearbyDemo' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for NearbyDemo
  pod 'NearbyMessages'
end

I’m using Cocoapods 1.8.4 and Xcode 11.2 (11B52) on macOS 10.15.1.

I’ve posted a “Nearby Messages API for iOS - Product feedback” report, but was wondering if anyone has found a workaround in the interim.


回答1:


After some searching, I found a workaround that should help with this behavior. You can achieve this by changing Xcode settings to use the old build system.

Xcode / File / Workspace Settings / Build system / select "Legacy Build System"

If you need further information, check out this link - https://github.com/CocoaPods/CocoaPods/issues/8122



来源:https://stackoverflow.com/questions/58808578/google-nearbymessages-cocoapod-generates-duplicate-output-file-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!