I'm not too knowledgable with Carthage but adding this here for tracking it. Saw this issue in RxAlamofire. With a Cartfile as follows:
github "ReactiveX/RxSwift" ~> 5.0
github "RxSwiftCommunity/RxAlamofire" ~> 5.0
And running carthage update --platform iOS --no-use-binaries
Getting the following output:
error: Multiple commands produce '/Users/freak4pc/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2.1_10E1001/RxAlamofire/5.0.0/Build/Intermediates.noindex/ArchiveIntermediates/RxAlamofire-iOS/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/RxSwift.framework':
1) Target 'RxSwift-iOS' has create directory command with output '/Users/freak4pc/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2.1_10E1001/RxAlamofire/5.0.0/Build/Intermediates.noindex/ArchiveIntermediates/RxAlamofire-iOS/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/RxSwift.framework'
2) Target 'RxSwift-watchOS' has create directory command with output '/Users/freak4pc/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2.1_10E1001/RxAlamofire/5.0.0/Build/Intermediates.noindex/ArchiveIntermediates/RxAlamofire-iOS/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/RxSwift.framework'
It seems watchOS and iOS builds both create a RxSwift.framework with the same name, which causes some collision.
i had this issue removed the duplicate from Targets/embed frameworks highlight duplicate and remove with the minus button, this obviously isnt a solution but a work around for anyone with the issue
I have the same issue. The build was rejected after uploading to Appstore connect with the following message
ITMS-90806: CFBundleIdentifier collision - Each bundle must have a unique bundle identifier. The bundle identifier 'io.rx.RxSwift' is used in the bundles '[RxSwift.framework, RxSwift.framework]'
uploading the build after the changing the bundle identifier of RxSwift framework inside watch extension worked
@clementprem my project has the same issue. How did you change the bundle identifier just for the framework inside the watch extension?
Quite a few libs have run into this problem recently - Alamofire seems to be just adding $PLATFORM_NAME to the bundle e.g. org.alamofire.Alamofire.${PLATFORM_NAME}.
https://github.com/Alamofire/Alamofire/issues/2925
@dlewanda What I've done is temporarily run a little script in our build process which does a find/replace for watchOS targets - very hacky but gets our builds through for now
@jklp thanks for chiming in. I was looking to make a similar change to the one you describe Alamofire as making in my fork of RxSwift, but I didn鈥檛 see how that would work as the framework is universal without platform-specific targets.
Can you explain in more detail what your script is doing, and when in the build process it is run? We are using Carthage to pull the binary for the 4.5.0 release directly, so I鈥檓 unclear as to how we can modify that.
@dlewanda
I did the following to make it work
/Users/<user>/Library/Developer/Xcode/Archives/2019-08-29/<AppName>\ 2019-08-29,\ 18.39.xcarchive/Products/Applications/<AppName>.app/Watch/<AppName>\ WatchKit\ App.app/PlugIns/<AppName>\ WatchKit\ Extension.appex/Frameworks/RxSwift.framework/Info.plistThe script is doing the same. Will try to find a proper fix but this works for now
Thanks for the details @clementprem - our app is built by Fastlane via CI so it'd be a challenging manual step to intercept it and make this change without automating it. We can try it in the meantime, but if anyone has a path forward on automating that process, I'd appreciate any tips!
@dlewanda Yep we're on fastlane too so it's a 2 part-er
Pt.1) In ./fastlane/fastfile added this line after the carthage() command
carthage(command: "bootstrap", cache_builds: "true", platform: "iOS,watchOS")
sh("../update_bundle_id.sh ../") <-- this line here
Pt.2) Create ./update_bundle_id.sh, which contains:
#!/bin/bash
find $1/Carthage/Build/watchOS/RxSwift.framework -name "Info.plist" -exec plutil -replace "CFBundleIdentifier" -string "io.rx.RxSwift.watchos" {} \;
(include other frameworks here)
It literally edits the built RxSwift.framework for watchOS, and manually replaces the bundle identifier in the plist.
Very very hacky but does the trick for now.
Thanks @jklp - we went with an Xcode build phase but with the similar idea. It got through processing, submission and was approved for release. Definitely seems hack-tastic and suboptimal. I hope either Apple retracts the change or comes out with an explanation, but I'm not holding my breath 馃し鈥嶁檪 馃う鈥嶁檪
Has anyone else affected by the original issue started getting rejected by Apple again with a new error:
ITMS-90562: Invalid Bundle - The app submission can not be successfully recompiled from bitcode due to missing symbols during linking. You can try to reproduce and diagnose such issues locally by following the instructions from: https://developer.apple.com/library/archive/technotes/tn2432/_index.html
We are on Xcode 10.2 (still) and have not found any clear answers, but we're wondering if this is part of the fact that we are hacking the bundle identifier or if RxSwift is missing some bitcode somewhere
I'm closing every issue older than 6 months. If this is still an issue for you, please comment and I can reopen :) Thanks !
In this specific case I haven't experienced this issue since. Perhaps carthage fixed something :)
Most helpful comment
Thanks @jklp - we went with an Xcode build phase but with the similar idea. It got through processing, submission and was approved for release. Definitely seems hack-tastic and suboptimal. I hope either Apple retracts the change or comes out with an explanation, but I'm not holding my breath 馃し鈥嶁檪 馃う鈥嶁檪