Solve the problem of warning when using pod in xcode12 + swift 5

Time:2021-6-21

cause

After creating a new project, usepodInstall some components, the result is the following error

Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.

[!] The `bestWhiteNoise [Debug]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-bestWhiteNoise/Pods-bestWhiteNoise.debug.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

[!] The `bestWhiteNoise [Release]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-bestWhiteNoise/Pods-bestWhiteNoise.release.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

[!] The `bestWhiteNoiseUITests [Debug]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-bestWhiteNoise-bestWhiteNoiseUITests/Pods-bestWhiteNoise-bestWhiteNoiseUITests.debug.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

[!] The `bestWhiteNoiseUITests [Release]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target Support Files/Pods-bestWhiteNoise-bestWhiteNoiseUITests/Pods-bestWhiteNoise-bestWhiteNoiseUITests.release.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

After querying some documents, we found that it was the settings and settings in our projectPodsThe settings in are inconsistent, and the warning is displayed. In fact, it is an error, which may cause problems such as unsuccessful installation of your third-party components

Solution

Read a lot of articles, are searchingALWAYS_EMBED_SWIFT_STANDARD_LIBRARIESSet to$(inherited), but we didn’t elaborate on which places we need to set. Maybe it’s a pit for a novice like me. In fact, we need to set every oneTARGETSInALWAYS_EMBED_SWIFT_STANDARD_LIBRARIESby$(inherited)

As shown in the figure:

Solve the problem of warning when using pod in xcode12 + swift 5

Solve the problem of warning when using pod in xcode12 + swift 5

Solve the problem of warning when using pod in xcode12 + swift 5

Save, thenTARGETSFor each of the three in my picture, I need to set all three

After setting, run it againpod installJust fine