Hello, I am with a long running project that is written in Objective-c and Swift (more). I have added a widget target extension to the project, but can't compile since there is this issue:
What is the potential problem and how to solve it?
= swiftsourceinfo
Multiple commands produce '.../Build/Products/Debug-iphonesimulator/MyApp.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo'
Target 'MyApp' (project 'MyApp') has copy command from '.../Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/arm64/MyApp.swiftsourceinfo' to '.../Build/Products/Debug-iphonesimulator/MyApp.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo'
Target 'MyAppWidgetsExtension' (project 'MyApp') has copy command from '.../Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyAppWidgetsExtension.build/Objects-normal/arm64/MyApp.swiftsourceinfo' to '.../Build/Products/Debug-iphonesimulator/MyApp.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo'
= arm64-apple-ios-simulator.abi.json
Multiple commands produce '.../Build/Products/Debug-iphonesimulator/MyApp.swiftmodule/arm64-apple-ios-simulator.abi.json'
Target 'MyApp' (project 'MyApp') has copy command from '.../Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/arm64/MyApp.abi.json' to '.../Build/Products/Debug-iphonesimulator/MyApp.swiftmodule/arm64-apple-ios-simulator.abi.json'
Target 'MyAppWidgetsExtension' (project 'MyApp') has copy command from '.../Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyAppWidgetsExtension.build/Objects-normal/arm64/MyApp.abi.json' to '.../Build/Products/Debug-iphonesimulator/MyApp.swiftmodule/arm64-apple-ios-simulator.abi.json'
= .swiftdoc
Multiple commands produce '.../Build/Products/Debug-iphonesimulator/MyApp.swiftmodule/arm64-apple-ios-simulator.swiftdoc'
Target 'MyApp' (project 'MyApp') has copy command from '.../Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/arm64/MyApp.swiftdoc' to '.../Build/Products/Debug-iphonesimulator/MyApp.swiftmodule/arm64-apple-ios-simulator.swiftdoc'
Target 'MyAppWidgetsExtension' (project 'MyApp') has copy command from '.../Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyAppWidgetsExtension.build/Objects-normal/arm64/MyApp.swiftdoc' to '.../Build/Products/Debug-iphonesimulator/MyApp.swiftmodule/arm64-apple-ios-simulator.swiftdoc'
= .swiftmodule
Multiple commands produce '.../Build/Products/Debug-iphonesimulator/MyApp.swiftmodule/arm64-apple-ios-simulator.swiftmodule'
Target 'MyApp' (project 'MyApp') has copy command from '.../Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/arm64/MyApp.swiftmodule' to '.../Build/Products/Debug-iphonesimulator/MyApp.swiftmodule/arm64-apple-ios-simulator.swiftmodule'
Target 'MyAppWidgetsExtension' (project 'MyApp') has copy command from '.../Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyAppWidgetsExtension.build/Objects-normal/arm64/MyApp.swiftmodule' to '.../Build/Products/Debug-iphonesimulator/MyApp.swiftmodule/arm64-apple-ios-simulator.swiftmodule'
Here's how I fixed it...
- Select your Extension target and go to Build Settings
- Search for "module" and look for Packaging -> Product Module Name. You'll probably see that the "Resolved" column is showing the same name as your main target.
- Type a unique name in the middle column (the column is titled "WidgetsExtension" or whatever your extension target is called)
- You should see that the "Resolved" column now shows the unique name you entered.
It should hopefully build now.