Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ARCHS[@]: unbound variable in Xcode 12

Tags:

ios

swift

xcode12

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.

like image 603
Alex Avatar asked Oct 22 '20 03:10

Alex


3 Answers

Note :- React native developers After wasting couple of hours only solution that worked for me was

Open VSCode and go to directory ios/App/App.xcodeproj/project.pbxproj that file and perform a search EXCLUDED_ARCHS

EXCLUDED_ARCHS = arm64; 

and delete everyline containing EXCLUDED_ARCHS

like image 167
Harvinder Singh Avatar answered Nov 16 '22 10:11

Harvinder Singh


For Xcode 12.3, when there is no VALID_ARCHS property, follow below steps:

  1. Build Settings -> Build Active Architecture Only -> Debug -> Yes
  2. Add "arm64" in "Excluded Architectures" in build settings of both project and pods project, to run the app in simulator. Remove it while making build on device or archiving the app.
like image 35
Shivani Bajaj Avatar answered Nov 16 '22 11:11

Shivani Bajaj


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.

like image 17
Sunil Targe Avatar answered Nov 16 '22 10:11

Sunil Targe