Finding silent failures with Complie Swift Source Files - Command CompileSwiftSources - Failed with a nonzero exit code

Does anyone out there have a solution for finding errors that cause "Command CompileSwiftSources failed with a nonzero exit code. I see a lot of forum answers with specific solutions to their instances of this error. What I am looking for is a definitive way to find the failures.

First I am amazed that apple cannot improve this. I have read a lot of threads on this issue and it seems to be there in many versions of xcode. It seems to be the cause of a great deal of frustration and I have spent a week trying to get my project (that I inherited) to compile on the latest platform (Monteray and Xcode 13.01).

In my specific case I have a number of coco pods that are old versions but due to dependencies I have to use (to include MMChatFramework pod).

What I am seeing is numerous pods that compile with the following error.

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -incremental -module-name DropDown -Onone -enable-batch-mode -enforce-exclusivity=checked @/Users/markp/Library/Developer/Xcode/DerivedData/RisePrime-cgjzvszwmdvqryawymbhwlpsyeok/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/DropDown.build/Objects-normal/x86_64/DropDown.SwiftFileList -DDEBUG -D COCOAPODS -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk -target x86_64-apple-ios15.0-simulator -g -module-cache-path /Users/markp/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -Xfrontend -serialize-debugging-options -enable-testing -index-store-path /Users/markp/Library/Developer/Xcode/DerivedData/RisePrime-cgjzvszwmdvqryawymbhwlpsyeok/Index/DataStore -swift-version 5 -I /Users/markp/Library/Developer/Xcode/DerivedData/RisePrime-cgjzvszwmdvqryawymbhwlpsyeok/Build/Products/Debug-iphonesimulator/DropDown -F /Users/markp/Library/Developer/Xcode/DerivedData/RisePrime-cgjzvszwmdvqryawymbhwlpsyeok/Build/Products/Debug-iphonesimulator/DropDown -c -j12 -output-file-map /Users/markp/Library/Developer/Xcode/DerivedData/RisePrime-cgjzvszwmdvqryawymbhwlpsyeok/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/DropDown.build/Objects-normal/x86_64/DropDown-OutputFileMap.json -parseable-output -serialize-diagnostics -emit-dependencies -emit-module -emit-module-path /Users/markp/Library/Developer/Xcode/DerivedData/RisePrime-cgjzvszwmdvqryawymbhwlpsyeok/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/DropDown.build/Objects-normal/x86_64/DropDown.swiftmodule -Xcc -I/Users/markp/Library/Developer/Xcode/DerivedData/RisePrime-cgjzvszwmdvqryawymbhwlpsyeok/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/DropDown.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/markp/Library/Developer/Xcode/DerivedData/RisePrime-cgjzvszwmdvqryawymbhwlpsyeok/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/DropDown.build/DropDown-generated-files.hmap -Xcc -I/Users/markp/Library/Developer/Xcode/DerivedData/RisePrime-cgjzvszwmdvqryawymbhwlpsyeok/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/DropDown.build/DropDown-own-target-headers.hmap -Xcc -I/Users/markp/Library/Developer/Xcode/DerivedData/RisePrime-cgjzvszwmdvqryawymbhwlpsyeok/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/DropDown.build/DropDown-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/markp/Library/Developer/Xcode/DerivedData/RisePrime-cgjzvszwmdvqryawymbhwlpsyeok/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/DropDown.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/markp/Library/Developer/Xcode/DerivedData/RisePrime-cgjzvszwmdvqryawymbhwlpsyeok/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/DropDown.build/DropDown-project-headers.hmap -Xcc -I/Users/markp/Library/Developer/Xcode/DerivedData/RisePrime-cgjzvszwmdvqryawymbhwlpsyeok/Build/Products/Debug-iphonesimulator/DropDown/include -Xcc -I/Users/markp/Library/Developer/Xcode/DerivedData/RisePrime-cgjzvszwmdvqryawymbhwlpsyeok/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/DropDown.build/DerivedSources-normal/x86_64 -Xcc -I/Users/markp/Library/Developer/Xcode/DerivedData/RisePrime-cgjzvszwmdvqryawymbhwlpsyeok/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/DropDown.build/DerivedSources/x86_64 -Xcc -I/Users/markp/Library/Developer/Xcode/DerivedData/RisePrime-cgjzvszwmdvqryawymbhwlpsyeok/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/DropDown.build/DerivedSources -Xcc -DPOD_CONFIGURATION_DEBUG=1 -Xcc -DDEBUG=1 -Xcc -DCOCOAPODS=1 -emit-objc-header -emit-objc-header-path /Users/markp/Library/Developer/Xcode/DerivedData/RisePrime-cgjzvszwmdvqryawymbhwlpsyeok/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/DropDown.build/Objects-normal/x86_64/DropDown-Swift.h -import-underlying-module -Xcc -ivfsoverlay -Xcc /Users/markp/Library/Developer/Xcode/DerivedData/RisePrime-cgjzvszwmdvqryawymbhwlpsyeok/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/DropDown.build/unextended-module-overlay.yaml -working-directory /Users/markp/projects/RisePrime/Pods

Command CompileSwiftSources failed with a nonzero exit code

Strange thing that I have been able to remove this error on 3 of my 5 pods that have this error by issuing the command in a terminal. IE the /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc ... command from above error.

Unfortunately this does not help me with the last two pods I'm trying to complle (MBPhotoPicker 0.2.3 and IQKeyboardManagerSwift 6.5.9)

Also note that this error seems to be dependent on other pods. IE if I remove pods and include a pod that has the error it may disappear.

Very frustrating. Have tried all the standard stuff for this error including deintegrating pods, removing DerivedData, clean build, reboot, restart xcode, ...

Finding silent failures with Complie Swift Source Files - Command CompileSwiftSources - Failed with a nonzero exit code
 
 
Q