ARCHS[@]: unbound variable in Xcode 12

Alex picture Alex · Oct 22, 2020 · Viewed 9.5k times · Source

Our iOS project is built successfully in Xcode 11. However, on Xcode 12, it shows an error like this:

PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/NgoHoangLien/Library/Developer/Xcode/DerivedData/BeneKitten-asctqxwawireafgebpjujkfxjvcg/Build/Intermediates.noindex/BeneKitten.build/Debug-iphoneos/BeneKitten\ Dev.build/Script-6F989132ECCA2B13FEF9458F.sh (in target 'BeneKitten Dev' from project 'BeneKitten') cd /Users/NgoHoangLien/Project/Benekitten-iOS /bin/sh -c /Users/NgoHoangLien/Library/Developer/Xcode/DerivedData/BeneKitten-asctqxwawireafgebpjujkfxjvcg/Build/Intermediates.noindex/BeneKitten.build/Debug-iphoneos/BeneKitten\\ Dev.build/Script-6F989132ECCA2B13FEF9458F.sh

sent 1868986 bytes received 70 bytes 3738112.00 bytes/sec total size is 1868525 speedup is 1.00 /Users/NgoHoangLien/Project/Benekitten-iOS/Pods/Target Support Files/Pods-BeneKitten Dev/Pods-BeneKitten Dev-frameworks.sh: line 144: ARCHS[@]: unbound variable Command PhaseScriptExecution failed with a nonzero exit code.

I followed guides on the internet to make "arm64" for EXCLUDED_ARCHS. Delete VALID_ARCHS. But it still cannot compile. I hope you the senior engineers, experts like you can help me.

Answer

Sunil Targe picture Sunil Targe · Oct 30, 2020

You may try below steps:

  1. In Main Project(Not TARGETS), Go to build settings and add Simulator-iOS 14.0 SDK with value arm64 inside Excluded Architecture and repeat the same for the Pod project too.
  2. Delete VALID_ARCHS from your Main project and Pod project both.(You may open the project file in editor to delete this) [You already did this ✅ ]
  3. Upgrade all Pods to the latest version available.

Last, Clean Project and Re-Build.