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

Failure to archive with new build system, extensions, and subspec combinations #8206

Open
1 task done
paulb777 opened this issue Oct 19, 2018 · 105 comments
Open
1 task done
Labels
s2:confirmed Issues that have been confirmed by a CocoaPods contributor t2:defect These are known bugs. The issue should also contain steps to reproduce. PRs welcome!
Milestone

Comments

@paulb777
Copy link
Member

Report

What did you do?

Product -> Archive

What did you expect to happen?

Successful archive

What happened instead?

error: Multiple commands produce '/Users/paulbeusterien/Library/Developer/Xcode/DerivedData/NewBuild-Extension-Subspec-gpaqorhpcdsnzfbjncbmklpefpai/Build/Intermediates.noindex/ArchiveIntermediates/NewBuild-Extension-Subspec/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GTMSessionFetcher.framework':
1) Target 'GTMSessionFetcher-Core' has create directory command with output '/Users/paulbeusterien/Library/Developer/Xcode/DerivedData/NewBuild-Extension-Subspec-gpaqorhpcdsnzfbjncbmklpefpai/Build/Intermediates.noindex/ArchiveIntermediates/NewBuild-Extension-Subspec/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GTMSessionFetcher.framework'
2) Target 'GTMSessionFetcher-Core-Full' has create directory command with output '/Users/paulbeusterien/Library/Developer/Xcode/DerivedData/NewBuild-Extension-Subspec-gpaqorhpcdsnzfbjncbmklpefpai/Build/Intermediates.noindex/ArchiveIntermediates/NewBuild-Extension-Subspec/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GTMSessionFetcher.framework'

CocoaPods Environment

Also occurs with 1.6.0

Stack

   CocoaPods : 1.5.3
        Ruby : ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin17]
    RubyGems : 2.6.13
        Host : Mac OS X 10.13.6 (17G65)
       Xcode : 10.0 (10A255)
         Git : git version 2.19.0.605.g01d371f741-goog
Ruby lib dir : /Users/paulbeusterien/.rbenv/versions/2.4.0/lib
Repositories : cpdc-eap-spec - sso://cpdc-eap/spec @ 0fd9263ede63bee9aec1034b38771950cd7e147a
               cpdc-internal-spec - sso://cpdc-internal/spec @ 98ecdc63c0d9c742bd186a2da06b64e3b40899dd
               cpdc-test-spec - sso://cpdc-test/spec @ 00c36f2a45e0fabc743572254402411c8493396e
               master - https://github.com/CocoaPods/Specs.git @ f5bb69af3467f6ccb449624f29a53a388167a445
               temp-specs - git@github.com:paulb777/Specs.git @ e945099cd9c9d8b8a34cc583662c9a2b150893f0

Installation Source

Executable Path: /Users/paulbeusterien/.rbenv/versions/2.4.0/bin/pod

Plugins

claide-plugins         : 0.9.2
cocoapods-deintegrate  : 1.0.2
cocoapods-dependencies : 1.1.0
cocoapods-generate     : 1.0.0
cocoapods-packager     : 1.5.0
cocoapods-plugins      : 1.0.0
cocoapods-rome         : 1.0.0
cocoapods-search       : 1.0.0
cocoapods-stats        : 1.0.0
cocoapods-trunk        : 1.3.1
cocoapods-try          : 1.1.0
cocoapods_debug        : 0.1.0

Podfile

platform :ios, '9.0'

use_frameworks!

target 'MessageExtension' do
  pod 'GTMSessionFetcher/Core'
end

target 'NewBuild-Extension-Subspec' do
  pod 'GTMSessionFetcher/Full'

end

Project that demonstrates the issue

https://github.com/paulb777/NewBuildExtensionSubspec

Likely a direct result of creating two build targets for the GTMSessionFetcher CocoaPod:

screen shot 2018-10-19 at 4 41 07 pm

@tomspee
Copy link

tomspee commented Oct 23, 2018

I've the exact same issue with multiple targets that use different iOS versions (10.0 & 12.0)

error: Multiple commands produce '/Users/tomspee/Library/Developer/Xcode/DerivedData/Company-hhmrvgkwkpelmlewuxvhclfggdtc/Build/Intermediates.noindex/ArchiveIntermediates/Company/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/ObjectMapper.framework':
1) Target 'ObjectMapper-iOS12.0' has create directory command with output '/Users/tomspee/Library/Developer/Xcode/DerivedData/Company-hhmrvgkwkpelmlewuxvhclfggdtc/Build/Intermediates.noindex/ArchiveIntermediates/Company/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/ObjectMapper.framework'
2) Target 'ObjectMapper-iOS10.0' has create directory command with output '/Users/tomspee/Library/Developer/Xcode/DerivedData/Company-hhmrvgkwkpelmlewuxvhclfggdtc/Build/Intermediates.noindex/ArchiveIntermediates/Company/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/ObjectMapper.framework'

@paulb777 Did you manage to fix this issue?

@paulb777
Copy link
Member Author

@tomspee So far, I only have the workaround of changing the Podfile so that extensions don't use a different subset of subspecs that the app. Your issue may be different - same symptom, but different cause.

@vinceis1337
Copy link

vinceis1337 commented Oct 23, 2018

I have the same issue.

I think the reason that there are duplicate frameworks could be because there are multiple projects in the same workspace. It appears to be due to how the naming works when creating frameworks.

We have a dependency
pod 'Appboy-iOS-SDK'
which defines a subspec dependency

  s.subspec 'ContentCards' do |scc|
    scc.source_files = 'AppboyUI/ABKContentCardsViewController/ContentCardsViewController/**/*.*', 'AppboyUI/ABKUIUtils/**/*.*', 'AppboyKit/ABKSDWebImageProxy.m'
    scc.resource = 'AppboyUI/ABKContentCardsViewController/ContentCards_Resources/**/*.*'
    scc.dependency 'Appboy-iOS-SDK/Core'
    scc.dependency 'SDWebImage/GIF', '~>4.0'
  end

We have a separate dependency
pod 'SDWebImage' which defines a default subspec s.default_subspec = 'Core'

Because SDWebImage/GIF depends on SDWebImage/Core, the system builds the Core framework for each project that needs it.

This causes our workspace to have a collision with two frameworks named:
"${BUILT_PRODUCTS_DIR}/SDWebImage.default-GIF/SDWebImage.framework",
and
"${BUILT_PRODUCTS_DIR}/SDWebImage-Core-GIF/SDWebImage.framework",

Note that these are in two separate projects but compiling down into one app.

@tomspee
Copy link

tomspee commented Oct 23, 2018

I've been testing for a while and I've created an empty project with just 2 targets, one main project and one widget. In the Podfile both targets (with different platforms, iOS 10 & 12) use just one shared pod, Alamofire. Also then I'm getting the same errors.

@vinceis1337 Do you have a solution/workaround?

@vinceis1337
Copy link

vinceis1337 commented Oct 24, 2018

@tomspee Workaround is to specify subspec explicitly i.e.

pod 'SDWebImage'
change to
pod 'SDWebImage/Core'

This causes the build product path to always have the subspec name (in this example -Core-instead of -.default-)

Hmm..this might not work for you though because I don't think Alamofire has subspecs does it?

Could you post the error logs?

@sirghi
Copy link

sirghi commented Nov 22, 2018

Same problem here. Even though the targets contain the subspec names (-Core-...), they still produce the same framework name in the Products, leading to the build failure.

@levigroker
Copy link

levigroker commented Dec 6, 2018

Yep. I'm seeing this in our project using a pod with multiple sub-specs referenced from different targets. This is a show stopper... 1.6.0.beta.2.

error: Multiple commands produce '/Users/xcodeserver/Library/Caches/XCSBuilder/Bots/82a75fec2007332e806edaa27b01db63/DerivedData/Build/Intermediates.noindex/ArchiveIntermediates/MyProject/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/CASComponentLibrary.framework':
1) Target 'Foo-FoundationExtensions-Model' has create directory command with output '/Users/xcodeserver/Library/Caches/XCSBuilder/Bots/82a75fec2007332e806edaa27b01db63/DerivedData/Build/Intermediates.noindex/ArchiveIntermediates/MyProject/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Foo.framework'
2) Target 'Foo-FoundationExtensions-Logging-Model-SecureStore' has create directory command with output '/Users/xcodeserver/Library/Caches/XCSBuilder/Bots/82a75fec2007332e806edaa27b01db63/DerivedData/Build/Intermediates.noindex/ArchiveIntermediates/MyProject/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Foo.framework'
3) Target 'Foo-55ceec23' has create directory command with output '/Users/xcodeserver/Library/Caches/XCSBuilder/Bots/82a75fec2007332e806edaa27b01db63/DerivedData/Build/Intermediates.noindex/ArchiveIntermediates/MyProject/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Foo.framework'

Please note the suggested workaround gives no relief.

Additionally, I have a lot of related warnings coming from the build system. Notably unexpected mutating task and duplicate output file (which has nothing to do with inadvertently included plist files).

Build system information
warning: unexpected mutating task ('SetOwnerAndGroup xcodeserver:staff /Users/xcodeserver/Library/Caches/XCSBuilder/Bots/82a75fec2007332e806edaa27b01db63/DerivedData/Build/Intermediates.noindex/ArchiveIntermediates/MyProject/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Foo.framework') with no relation to prior mutator ('SetOwnerAndGroup xcodeserver:staff /Users/xcodeserver/Library/Caches/XCSBuilder/Bots/82a75fec2007332e806edaa27b01db63/DerivedData/Build/Intermediates.noindex/ArchiveIntermediates/MyProject/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Foo.framework') (in target 'Foo-FoundationExtensions-Model')

Build system information
warning: unexpected mutating task ('SetOwnerAndGroup xcodeserver:staff /Users/xcodeserver/Library/Caches/XCSBuilder/Bots/82a75fec2007332e806edaa27b01db63/DerivedData/Build/Intermediates.noindex/ArchiveIntermediates/MyProject/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Foo.framework') with no relation to prior mutator ('SetOwnerAndGroup xcodeserver:staff /Users/xcodeserver/Library/Caches/XCSBuilder/Bots/82a75fec2007332e806edaa27b01db63/DerivedData/Build/Intermediates.noindex/ArchiveIntermediates/MyProject/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Foo.framework') (in target 'Foo-FoundationExtensions-Model')

Build system information
warning: unexpected mutating task ('SetMode u+w,go-w,a+rX /Users/xcodeserver/Library/Caches/XCSBuilder/Bots/82a75fec2007332e806edaa27b01db63/DerivedData/Build/Intermediates.noindex/ArchiveIntermediates/MyProject/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Foo.framework') with no relation to prior mutator ('SetMode u+w,go-w,a+rX /Users/xcodeserver/Library/Caches/XCSBuilder/Bots/82a75fec2007332e806edaa27b01db63/DerivedData/Build/Intermediates.noindex/ArchiveIntermediates/MyProject/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Foo.framework') (in target 'Foo-FoundationExtensions-Model')

Build system information
warning: unexpected mutating task ('SetMode u+w,go-w,a+rX /Users/xcodeserver/Library/Caches/XCSBuilder/Bots/82a75fec2007332e806edaa27b01db63/DerivedData/Build/Intermediates.noindex/ArchiveIntermediates/MyProject/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Foo.framework') with no relation to prior mutator ('SetMode u+w,go-w,a+rX /Users/xcodeserver/Library/Caches/XCSBuilder/Bots/82a75fec2007332e806edaa27b01db63/DerivedData/Build/Intermediates.noindex/ArchiveIntermediates/MyProject/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Foo.framework') (in target 'Foo-FoundationExtensions-Model')

Build system information
warning: duplicate output file '/Users/xcodeserver/Library/Caches/XCSBuilder/Bots/82a75fec2007332e806edaa27b01db63/DerivedData/Build/Intermediates.noindex/ArchiveIntermediates/MyProject/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Foo.framework/Headers/NSDecimalNumber+Creation.h' on task: CpHeader /Users/xcodeserver/Library/Caches/XCSBuilder/Bots/82a75fec2007332e806edaa27b01db63/Source/MyProject/Pods/Foo/CCLFoundationExtensions/CCLFoundationExtensions/NSDecimalNumber+Creation.h /Users/xcodeserver/Library/Caches/XCSBuilder/Bots/82a75fec2007332e806edaa27b01db63/DerivedData/Build/Intermediates.noindex/ArchiveIntermediates/MyProject/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Foo.framework/Headers/NSDecimalNumber+Creation.h (in target 'Foo-FoundationExtensions-Logging-Model-SecureStore')

Build system information
warning: duplicate output file '/Users/xcodeserver/Library/Caches/XCSBuilder/Bots/82a75fec2007332e806edaa27b01db63/DerivedData/Build/Intermediates.noindex/ArchiveIntermediates/MyProject/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Foo.framework/Headers/NSJSONSerialization+Safe.h' on task: CpHeader /Users/xcodeserver/Library/Caches/XCSBuilder/Bots/82a75fec2007332e806edaa27b01db63/Source/MyProject/Pods/Foo/CCLFoundationExtensions/CCLFoundationExtensions/NSJSONSerialization+Safe.h /Users/xcodeserver/Library/Caches/XCSBuilder/Bots/82a75fec2007332e806edaa27b01db63/DerivedData/Build/Intermediates.noindex/ArchiveIntermediates/MyProject/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Foo.framework/Headers/NSJSONSerialization+Safe.h (in target 'Foo-FoundationExtensions-Logging-Model-SecureStore')

Build system information
warning: duplicate output file '/Users/xcodeserver/Library/Caches/XCSBuilder/Bots/82a75fec2007332e806edaa27b01db63/DerivedData/Build/Intermediates.noindex/ArchiveIntermediates/MyProject/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Foo.framework/Headers/NSObject+NilTolerantEqual.h' on task: CpHeader /Users/xcodeserver/Library/Caches/XCSBuilder/Bots/82a75fec2007332e806edaa27b01db63/Source/MyProject/Pods/Foo/CCLFoundationExtensions/CCLFoundationExtensions/NSObject+NilTolerantEqual.h /Users/xcodeserver/Library/Caches/XCSBuilder/Bots/82a75fec2007332e806edaa27b01db63/DerivedData/Build/Intermediates.noindex/ArchiveIntermediates/MyProject/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Foo.framework/Headers/NSObject+NilTolerantEqual.h (in target 'Foo-FoundationExtensions-Logging-Model-SecureStore')

Build system information
warning: duplicate output file '/Users/xcodeserver/Library/Caches/XCSBuilder/Bots/82a75fec2007332e806edaa27b01db63/DerivedData/Build/Intermediates.noindex/ArchiveIntermediates/MyProject/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Foo.framework/Headers/NSString+Utils.h' on task: CpHeader /Users/xcodeserver/Library/Caches/XCSBuilder/Bots/82a75fec2007332e806edaa27b01db63/Source/MyProject/Pods/Foo/CCLFoundationExtensions/CCLFoundationExtensions/NSString+Utils.h /Users/xcodeserver/Library/Caches/XCSBuilder/Bots/82a75fec2007332e806edaa27b01db63/DerivedData/Build/Intermediates.noindex/ArchiveIntermediates/MyProject/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Foo.framework/Headers/NSString+Utils.h (in target 'Foo-FoundationExtensions-Logging-Model-SecureStore')

@rostopira
Copy link

Any progress on this?
I need SDWebImage/WebP pod in app and in notification extension
Current workaround is to use carthage for extension, and cocoapods for app, but it feels weird

@paulb777
Copy link
Member Author

This issue seems related to #7733 where @segiddins says "CocoaPods can only embed a single framework with a given name, so you're not able to expose different functionality to the extension and the main app by using subspecs". However, this issue is different since these examples work fine with the old build system.

@paulb777 paulb777 self-assigned this Jan 1, 2019
@paulb777
Copy link
Member Author

paulb777 commented Jan 1, 2019

I'm working on a fix to make sure that an extension target's pod targets include the subspec combinations of its host app.

@paulb777
Copy link
Member Author

paulb777 commented Jan 2, 2019

I got a fix working for the basic case of directly depending upon different subspec combinations.

However, I'm not sure what to do about the case where the subspec combination is coming transitively via another target. It doesn't seem right to try to change that other target.

I'm starting to think that subspecs are not scalable for source pods, since they imply different variations of the same named library could be needed and different variations of the same-named library does not work well with the Xcode builder and loader.

Should CocoaPods be change or have an option to build a different library for each subspec?

@dnkoutso
Copy link
Contributor

dnkoutso commented Jan 2, 2019

I think we need to rethink subspecs entirely in 2.x.

@paulb777
Copy link
Member Author

paulb777 commented Jan 5, 2019

Here's an update from my ongoing investigation:

For subspecs from dynamic frameworks pods, there could have easily been load failures with the old build system depending on which subspec combination got copied into the app's Frameworks folder and which symbols are being used from which targets. For any workspace that ends up with different subspec combinations between an extension and the host app, it should be possible to make it fail at load time by calling methods from subspec combination that didn't get copied to the bundle. Therefore, it is arguable that the new archive failure is a good thing - although it would be much better for the build system to give the error - or at least a warning - in a regular build instead of waiting until archiving to expose it.

For subspecs from static frameworks pods, regular builds with the old and new build systems should always work fine because the right frameworks are built into appropriately labeled directory and properly linked into the right build targets. It doesn't matter which frameworks are copied into the bundle since static frameworks are linked at build time and not needed at load time.

The issue with the new build system is that the archiver wants to put all intermediate frameworks into the same directory instead of separate directories for each build target like the regular builder. I'm thinking about flushing this out a bit further and sending a Radar.

error: Multiple commands produce '/Users/paulbeusterien/Library/Developer/Xcode/DerivedData/NewBuild-Extension-Subspec-gaeuwroouqpzwlfwgiqtmknxbqjt/Build/Intermediates.noindex/ArchiveIntermediates/NewBuild-Extension-Subspec/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GoogleUtilities.framework':
1) Target 'GoogleUtilities-NSData+zlib' has create directory command with output '/Users/paulbeusterien/Library/Developer/Xcode/DerivedData/NewBuild-Extension-Subspec-gaeuwroouqpzwlfwgiqtmknxbqjt/Build/Intermediates.noindex/ArchiveIntermediates/NewBuild-Extension-Subspec/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GoogleUtilities.framework'
2) Target 'GoogleUtilities-Environment' has create directory command with output '/Users/paulbeusterien/Library/Developer/Xcode/DerivedData/NewBuild-Extension-Subspec-gaeuwroouqpzwlfwgiqtmknxbqjt/Build/Intermediates.noindex/ArchiveIntermediates/NewBuild-Extension-Subspec/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GoogleUtilities.framework'

@paulb777
Copy link
Member Author

paulb777 commented Jan 8, 2019

https://openradar.appspot.com/radar?id=5038526135533568

@federicocappelli
Copy link

The issue is still present in 1.6.0-rc1, the only solution for me was to switch back to the old build system.

@nikolay-kapustin
Copy link

https://openradar.appspot.com/radar?id=5038526135533568

I hope Apple fix that soon.

@bobspryn
Copy link

However, I'm not sure what to do about the case where the subspec combination is coming transitively via another target. It doesn't seem right to try to change that other target.

Yeah I'm running into this. We have two different google pods included. One requires GTMSessionFetcher and the others just include GTMSessionFetcher/Core. Even changing the prior to the GTMSessionFetcher/Full subspec doesn't work.

Not exactly sure what to do about this. Any other workarounds?

@paulb777
Copy link
Member Author

Maybe I'm misreading, but changing GTMSessionFetcher to GTMSessionFetcher/Full is a no-op since Full is the default subspec. The targets that require GTMSessionFetcher/Core should be changed to require GTMSessionFetcher/Full.

@bobspryn
Copy link

Yeah, you are exactly right. That's what I determined. Unfortunately I can't fix that without a bunch of PRs to various google pods or hosting a pod spec for it locally.

@paulb777
Copy link
Member Author

@sprynmr You should be able to add pod 'GTMSessionFetcher/Full' to the targets in the Podfile.

@bobspryn
Copy link

I can add their targets to my Podfile and override their podspec? To be clear, we include a couple google dependencies, which in turn include either GTMSessionFetcher or GTMSessionFetcher/Core in their podspec, thus the two targets created in my Pods workspace. I can override that without hacking their podspec files?

@paulb777
Copy link
Member Author

CocoaPods will union the dependencies from all the requested podspecs in the target of the Podfile, so you can explicitly add 'GTMSessionFetcher/Full', so that all of your targets end up matching the GTMSessionFetcher subspec subset.

@bobspryn
Copy link

Aha! I had tried that, and it didn’t work, so I looked closer. Turns out we also had Firebase/Auth required again (which in turn requires just GTMSessionFetcher) in the tests target for some reason. It was already inherited, so it wasn’t needed. Having that there caused the problem to persist. Removing that and adding GTMSessionFetcher/Full to the main Podfile (and the SNG podspec for good measure) fixes the issue.

Thanks for the help!

@rizwan95
Copy link

@rizwan95 or others: You can fin the Fastlane fix here:

https://gist.github.com/lifely/7f8b68bb3f1fed31da8c1a8aff93ae6b

It's override Fastlane Gym::Runner verify_archive function, fixing the archive before any export is done. You can drop it at the top of your Fastlane file as is. You might need to adds the required dependencies.

@lifely I tried your script but it is not working. I am getting the following error while trying to distribute. Not sure what I am missing.

2022-01-24 16:31:55 +0000 [MT] Step failed: <IDEDistributionPackagingStep: 0x7f957787a200>: Error Domain=DVTMachOErrorDomain Code=5 "Executable Not Found" UserInfo={NSLocalizedDescription=Executable Not Found, NSLocalizedRecoverySuggestion="{my_path}" is not a valid path to an executable file. Please rebuild the project to ensure that all required executables are created. Check your project settings to ensure that a valid executable will be built.}

If you could give a cocoapods-plugin I could try that way as well.

@lifely
Copy link

lifely commented Feb 2, 2022

@rizwan95

@lifely I tried your script but it is not working. I am getting the following error while trying to distribute. Not sure what I am missing.

It seems it doesn't found the correct path of the binary.

NSLocalizedRecoverySuggestion="{my_path}" is not a valid path to an executable file.

can you check or upload the archive.plist here, what's the path given in the applicationProperti attribute ?

@jrtibbetts
Copy link

jrtibbetts commented Feb 12, 2022

I've run into this same problem, albeit from a slightly different perspective. I'm developing a framework, and have two versions (beta and release) of a demonstration app that use the framework. Both pull in some third-party dependencies via CocoaPods.

  • The beta app uses the framework I'm developing in a git submodule, embeds the framework's project file, and adds the framework to the Frameworks, Libraries, and Embedded Content.

beta version

  • The release app gets the most recently-released pod of the framework:

release version

The Podfile:

platform :ios, '12.0'
use_frameworks!
source 'https://github.com/CocoaPods/Specs.git'

def default_pods
  pod 'Firebase/Crashlytics'
  pod 'RealmSwift', '~> 10.19.0'
end

target 'release' do
  pod 'Foo', '3.3.1'
  default_pods
end

target 'beta' do
  default_pods
end

Note that the Foo framework is not in the beta target's list of dependencies. I don't want to use Swift Package Manager for this, because our framework's repo is enormous (long story), and SPM takes several minutes to resolve packages. Perhaps Carthage would be a decent compromise.

@winstonschen
Copy link

I had the same problem and solved it like this: Add the problematic package EXPLICITLY for EACH target.

Let's say the error message complains about 'GTMSessionFetcher'. The likely reason is that you have multiple targets that have pods that are dependent on GTMSessionFetcher. The problem is solved if you add:

pod 'GTMSessionFetcher'

To each target.

@rizwan95
Copy link

@winstonschen I am not sure if this solution is right or wrong but it works!

@J-Korn
Copy link

J-Korn commented Jun 16, 2022

I am getting this error as well, xcode v13.31 on a project I 'inherited'. SDWebImage-Core-GIF and SDWebImage.default-gif both create the SDWebImage.framework, stopping me from archiving.

I read through all the replies but I didn't manage to make it work with any of the solutions proposed.
I have tried explicitly adding dependencies in the podfile for each of the two targets, with variations of SDWebImage, SDWebImage/Core, etc but no luck.

Anyone got SDWebImage to work?

@KimPenlon
Copy link

KimPenlon commented Jun 16, 2022 via email

@Nolascoin
Copy link

Happy New Year! 2023, issue still there btw...

@KimPenlon
Copy link

KimPenlon commented Jan 10, 2023 via email

@ksilz
Copy link

ksilz commented Jan 22, 2023

I got this error in my Flutter 3.3 app on iOS after adding Firebase Analytics & Performance. The only way to fix it was in this previous answer: Adding pod 'GoogleUtilities' both in the target 'Runner' do and the target 'ImageNotification' dosections. Thank you, @0xMarK!

@dnkoutso dnkoutso modified the milestones: 1.12.0, 1.12.1 Feb 27, 2023
@epicsagas
Copy link

Hi there,

I have fixes the issue with below code in my case.

platform :ios, '10.0'
use_frameworks!

def google_utilites
  pod 'GoogleUtilities/AppDelegateSwizzler'
  pod 'GoogleUtilities/Environment'
  pod 'GoogleUtilities/ISASwizzler'
  pod 'GoogleUtilities/Logger'
  pod 'GoogleUtilities/MethodSwizzler'
  pod 'GoogleUtilities/NSData+zlib'
  pod 'GoogleUtilities/Network'
  pod 'GoogleUtilities/Reachability'
  pod 'GoogleUtilities/UserDefaults'
  pod 'GTMSessionFetcher'
end

target 'myApp' do

  google_utilites

  pod 'Firebase/Auth'
  pod 'Firebase/Database'
  pod 'Firebase/Storage'
  pod 'Firebase/Analytics'
  pod 'GoogleSignIn'

end

target 'shareExtension' do

  google_utilites

  pod 'Firebase/Auth'
  pod 'Firebase/Database'
  pod 'Firebase/Storage'

end

nicely done!!

@dnkoutso dnkoutso modified the milestones: 1.12.1, 1.13.0 Apr 18, 2023
@NOTtheKRish
Copy link

I got this error in my Flutter 3.3 app on iOS after adding Firebase Analytics & Performance. The only way to fix it was in this previous answer: Adding pod 'GoogleUtilities' both in the target 'Runner' do and the target 'ImageNotification' dosections. Thank you, @0xMarK!

In my case, this helped me! Thanks!

@cpuell
Copy link

cpuell commented Feb 11, 2024

Maybe something worth noting..

When i add this ImageNotification as a new target, it sets the deployment target to the latest available version. Now in my case the platform :ios, '14.0' in my pod file and the ImageNotification had 17.2, now the issue appeared with the duplications, i also noted that it seems to create duplicates with the latest deployment target for other pods.

I set the deployment target both to 14.0, and tried a few things but this all didn't made the fix, other than duplicating the google utilities in both targets.

But maybe a hint to understand why it creates duplicate pods. idk.

@ahmedraza42
Copy link

ahmedraza42 commented May 14, 2024

Hi there,
I have fixes the issue with below code in my case.

platform :ios, '10.0'
use_frameworks!

def google_utilites
  pod 'GoogleUtilities/AppDelegateSwizzler'
  pod 'GoogleUtilities/Environment'
  pod 'GoogleUtilities/ISASwizzler'
  pod 'GoogleUtilities/Logger'
  pod 'GoogleUtilities/MethodSwizzler'
  pod 'GoogleUtilities/NSData+zlib'
  pod 'GoogleUtilities/Network'
  pod 'GoogleUtilities/Reachability'
  pod 'GoogleUtilities/UserDefaults'
  pod 'GTMSessionFetcher'
end

target 'myApp' do

  google_utilites

  pod 'Firebase/Auth'
  pod 'Firebase/Database'
  pod 'Firebase/Storage'
  pod 'Firebase/Analytics'
  pod 'GoogleSignIn'

end

target 'shareExtension' do

  google_utilites

  pod 'Firebase/Auth'
  pod 'Firebase/Database'
  pod 'Firebase/Storage'

end

nicely done!!

unable to build archive i already implement above code in my pod file but no success plz help
error:
Showing Recent Issues
Multiple commands produce '/Users/mohammadahmed/Library/Developer/Xcode/DerivedData/Mentoga-bhxgzgruerqtjihfkehfumnqiohp/Build/Intermediates.noindex/ArchiveIntermediates/Mentoga/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GoogleUtilities_Privacy.bundle'

xcode version 15.0.1
react native version 0.71.3

my podfile :
Screenshot 2024-05-14 at 11 46 58 AM

Screenshot 2024-05-14 at 11 47 09 AM

@lab-devoloper
Copy link

Hi there,
I have fixes the issue with below code in my case.

platform :ios, '10.0'
use_frameworks!

def google_utilites
  pod 'GoogleUtilities/AppDelegateSwizzler'
  pod 'GoogleUtilities/Environment'
  pod 'GoogleUtilities/ISASwizzler'
  pod 'GoogleUtilities/Logger'
  pod 'GoogleUtilities/MethodSwizzler'
  pod 'GoogleUtilities/NSData+zlib'
  pod 'GoogleUtilities/Network'
  pod 'GoogleUtilities/Reachability'
  pod 'GoogleUtilities/UserDefaults'
  pod 'GTMSessionFetcher'
end

target 'myApp' do

  google_utilites

  pod 'Firebase/Auth'
  pod 'Firebase/Database'
  pod 'Firebase/Storage'
  pod 'Firebase/Analytics'
  pod 'GoogleSignIn'

end

target 'shareExtension' do

  google_utilites

  pod 'Firebase/Auth'
  pod 'Firebase/Database'
  pod 'Firebase/Storage'

end

nicely done!!

unable to build archive i already implement above code in my pod file but no success plz help error: Showing Recent Issues Multiple commands produce '/Users/mohammadahmed/Library/Developer/Xcode/DerivedData/Mentoga-bhxgzgruerqtjihfkehfumnqiohp/Build/Intermediates.noindex/ArchiveIntermediates/Mentoga/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GoogleUtilities_Privacy.bundle'

xcode version 15.0.1 react native version 0.71.3

my podfile : Screenshot 2024-05-14 at 11 46 58 AM
Screenshot 2024-05-14 at 11 47 09 AM

invertase/firestore-ios-sdk-frameworks#72 (comment)

@sandeep14
Copy link

sandeep14 commented Aug 1, 2024

I am also getting same type of issue while creating archive , any solution for this

Showing Recent Issues

Prepare build
error: Multiple commands produce '/Users/aurus/Library/Developer/Xcode/DerivedData/Onference-cgoqpazsojiiyzdibeqgwomjirbt/Build/Intermediates.noindex/ArchiveIntermediates/Onference/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GoogleUtilities_Privacy.bundle'
note: Target 'GoogleUtilities-252de0bf-GoogleUtilities_Privacy' (project 'Pods') has create directory command with output '/Users/aurus/Library/Developer/Xcode/DerivedData/Onference-cgoqpazsojiiyzdibeqgwomjirbt/Build/Intermediates.noindex/ArchiveIntermediates/Onference/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GoogleUtilities_Privacy.bundle'
note: Target 'GoogleUtilities-54d832b6-GoogleUtilities_Privacy' (project 'Pods') has create directory command with output '/Users/aurus/Library/Developer/Xcode/DerivedData/Onference-cgoqpazsojiiyzdibeqgwomjirbt/Build/Intermediates.noindex/ArchiveIntermediates/Onference/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GoogleUtilities_Privacy.bundle'

Multiple commands produce '/Users/aurus/Library/Developer/Xcode/DerivedData/Onference-cgoqpazsojiiyzdibeqgwomjirbt/Build/Intermediates.noindex/ArchiveIntermediates/Onferenc

@tayejoseph
Copy link

Samehere, also having the same issue when creating archive

@tereshchova
Copy link

hi, just want to check if anyone has found a resolution on this?

@mudassarahmad09
Copy link

Hi, i am also getting same error, any solution?

@PollyGlot
Copy link

Same for me but with app_tracking_transparency package for Flutter :

error: Multiple commands produce '/Users/distiller/Library/Developer/Xcode/DerivedData/Runner-gzyolajtuwzzcpdukxuqjffaibap/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/app_tracking_transparency_privacy.bundle'

I get the same error when I revert to 2.0.4 when PrivacyInfo.xcprivacy wasn't added yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s2:confirmed Issues that have been confirmed by a CocoaPods contributor t2:defect These are known bugs. The issue should also contain steps to reproduce. PRs welcome!
Projects
None yet
Development

No branches or pull requests