I'm getting these errors when trying to archive my app for the App Store. During testing these never resent themselves. I found a similar post here but the solution doesn't work for me as I don't have the offending files in that build phase. I am using pods to install, so I don't know if that would make the solution different.
1) Target 'Realm-iOS11.0' has create directory command with output '/Users/user/Library/Developer/Xcode/DerivedData/.../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Realm.framework'
2) Target 'Realm-iOS12.2' has create directory command with output '/Users/user/Library/Developer/Xcode/DerivedData/.../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Realm.framework'
Second error
1) Target 'RealmSwift-iOS11.0' has create directory command with output '/Users/user/Library/Developer/Xcode/DerivedData/.../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/RealmSwift.framework'
2) Target 'RealmSwift-iOS12.2' has create directory command with output '/Users/user/Library/Developer/Xcode/DerivedData/.../IntermediateBuildFilesPath/UninstalledProducts/iphoneos/RealmSwift.framework'