iOS-watchOS应用发布报错ITMS-90806:CFBundleIdentifier冲突求助
Hey there, I hit this exact same issue a couple weeks back when uploading an app with both iOS and watchOS targets using CocoaLumberjack. Turns out Apple did tighten up their bundle ID uniqueness checks recently—even across different platform targets, you can’t have duplicate bundle IDs for framework bundles anymore. Here are the fixes that worked for me:
Solution 1: Use a CocoaPods Post-Install Hook to Modify WatchOS Bundle ID
Add this script to the end of your Podfile to automatically adjust the bundle ID of the watchOS version of CocoaLumberjack. This ensures it’s unique from the iOS version:
post_install do |installer| installer.pods_project.targets.each do |target| # Target names might vary slightly depending on the subspec you're using next unless target.name == 'CocoaLumberjack' || target.name == 'CocoaLumberjackSwift' if target.platform_name == :watchos target.build_configurations.each do |config| info_plist_path = config.build_settings['INFOPLIST_FILE'] next unless info_plist_path && File.exist?(info_plist_path) # Read and update the Info.plist to add a .watchos suffix to the bundle ID plist_content = File.read(info_plist_path) updated_content = plist_content.gsub( /<key>CFBundleIdentifier<\/key>\s*<string>org.cocoapods.CocoaLumberjack<\/string>/, '<key>CFBundleIdentifier</key><string>org.cocoapods.CocoaLumberjack.watchos</string>' ) File.write(info_plist_path, updated_content) end end end end
After adding this, run pod install again. Xcode will now use a unique bundle ID for the watchOS version of the framework, avoiding the conflict.
Solution 2: Upgrade CocoaLumberjack to a Newer Version
Check if there’s an updated version of CocoaLumberjack that already addresses this platform-specific bundle ID issue. As of version 4.x, the library has fixed this by assigning distinct bundle IDs for iOS, watchOS, and other platforms.
Update your Podfile to use the latest compatible version:
pod 'CocoaLumberjack/Swift', '~> 4.0'
Then run pod update CocoaLumberjack and rebuild your project. This is the cleanest fix if your app supports the newer version.
Solution 3: Manual Fix for Carthage Users
If you’re using Carthage instead of CocoaPods, you’ll need to modify the watchOS framework’s Info.plist manually after building:
- Run
carthage updateto build the frameworks. - Navigate to
Carthage/Build/watchOS/CocoaLumberjack.framework/Info.plist. - Change the
CFBundleIdentifiervalue fromorg.cocoapods.CocoaLumberjackto something unique likeorg.cocoapods.CocoaLumberjack.watchos. - Re-embed the modified framework into your watchOS extension target and reupload.
Verification Step
Before uploading, double-check the bundle IDs:
- In Xcode, go to your Pods project → find the iOS
CocoaLumberjacktarget → open its Info.plist. Confirm the bundle ID isorg.cocoapods.CocoaLumberjack. - Do the same for the watchOS
CocoaLumberjacktarget—its bundle ID should have the.watchossuffix (or whatever unique value you chose).
This should resolve the ITMS-90806 error immediately.
内容的提问来源于stack exchange,提问作者cristallo

