Package Loading: "Ignoring duplicate product" (SwiftPM)

This is an issue often encountered if you are attempting to build a library/framework but also have a main.swift file in your target's root directory, like so:

enter image description here.

The presence of a main.swift file makes SwiftPM believe that you are attempting to build a command line tool, and thus complains about the unnecessary (duplicate in name) library produced.

This warning may be confusing as it does not occur in projects initialized with the dynamic framework template from Xcode, for iOS, macOS, tvOS or watchOS.