Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode11 Archive fails: no such file or directory Objects-normal/arm64/UniversalSDK.SwiftFileList

I am trying to build a universal framework from existing source code in Xcode11. When I Archive, it fails with following error:

/<unknown>:1:1: no such file or directory: '/Users/apple/SANDBOX/VoiceSampler/@/Users/apple/Library/Developer/Xcode/DerivedData/VoiceSampler-foeghskagbaeclezzbypkqnjnuos/Build/Intermediates.noindex/ArchiveIntermediates/BuildUniversalSDK/IntermediateBuildFilesPath/VoiceSampler.build/Release-iphoneos/UniversalSDK.build/Objects-normal/arm64/UniversalSDK.SwiftFileList'

/:1:1: no such file or directory: '/Users/apple/SANDBOX/VoiceSampler/@/Users/apple/Library/Developer/Xcode/DerivedData/VoiceSampler-foeghskagbaeclezzbypkqnjnuos/Build/Intermediates.noindex/ArchiveIntermediates/BuildUniversalSDK/IntermediateBuildFilesPath/VoiceSampler.build/Release-iphoneos/UniversalSDK.build/Objects-normal/arm64/UniversalSDK.SwiftFileList'

I was able to Archive the same in Xcode 10.3 earlier. Not sure what changed.

enter image description here

Please help me solve this Archive error.

like image 804
Bharat Biswal Avatar asked Sep 27 '19 10:09

Bharat Biswal


2 Answers

I don't know if it helps, but for me it happens when I run the Swift compiler manually from inside XCode (a script which builds a separate Swift framework). XCode sets the environment variable SWIFT_RESPONSE_FILE_PATH_normal_x86_64 (variant and architecture) which points to that particular missing .SwiftFileList file. Unsetting this environmant variable solved the issue for us.

This is how we unset it in the external script:

for V in ${BUILD_VARIANTS}; do
    for A in ${ARCHS}; do
        unset SWIFT_RESPONSE_FILE_PATH_${V}_${A}
    done
done
like image 153
Georg Avatar answered Sep 20 '22 01:09

Georg


For me the issue was related with using the legacy build system instead of the new one (in Xcode 11). Once I switched to the New Build System (in File -> Workspace/Project Settings), these new lines started to appear in the build log:

WriteAuxiliaryFile /Users/.../XXXXXX.SwiftFileList (in target 'XXXX' from project 'XXX')
like image 45
PedroCarvalho Avatar answered Sep 18 '22 01:09

PedroCarvalho