10

Error in detail, the black area is the name of the project and its sub-directoryError from Xcode I am sorry for the black marks in the image.

I have seen multiple posts suggesting an answer to this problem, Lock unlocks keychain (tried it), pod Update (tried it), clear build(tried it), signing, skip install in build settings(tried it) - None of them actually worked.

I built my iOS app in react native with Expo, after which I did expo eject to create the iOS folder for Xcode build and archiving, the build is successful every time and it even runs on the simulator and in my device(iPhone 7) but it always failed to archive by throwing this error - Uncategorised - Command PhaseScriptExecution failed with a non zero exit code..

Any help to point me in which direction should I go or what can be the possible mistake that I am doing will be of great help. Do let me know if, I should provide any more detail about this. Thank you!

Xcode Version - 11.0 Mac Version - 10.15 Catalina iPhone OS - 13.1.3

Few links I tried from -

  1. "${PODS_ROOT}/SwiftLint/swiftlint" causes "Command PhaseScriptExecution failed with a nonzero exit code" with Xcode 10
  2. https://github.com/apollographql/apollo-ios/issues/395
  3. https://www.reddit.com/r/iOSProgramming/comments/al9box/getting_an_error_command_phasescriptexecution/
Abhilash Bhargava
  • 574
  • 1
  • 5
  • 17
  • I can't seem to find the thread but have you tried `xattr -d com.apple.quarantine "path/to/frameworks.sh"` in terminal? – Soroush Oct 18 '19 at 07:16
  • Hi @Soroush - I just did it in the terminal - it says no such file, if possible do tell what this is and what does it do? – Abhilash Bhargava Oct 18 '19 at 07:20
  • you need to change the path accordingly. double click on the error to see the details. you may share a screenshot. – Soroush Oct 18 '19 at 07:23
  • I added the screenshot of the error, and I was not able to find this file in my directory. – Abhilash Bhargava Oct 18 '19 at 07:43
  • @Soroush Is there anything else that you need from my end? – Abhilash Bhargava Oct 18 '19 at 14:53
  • what I've suggested earlier is not related to this error. Look for `Unexpected end of JSON input` on google. It's related to react-native maybe. I've voted up your question so it can get more attention. – Soroush Oct 18 '19 at 20:56
  • Hi again Abhilash, I believe that I can help you with this issue, but at least you can provide with me a minimal reproducible example? – FreakyCoder Oct 19 '19 at 09:55
  • @Kuray-FreakyCoder- So, I was able to archive my app the first time, after which I did all the version updates and created the iOS folder with expo eject and did pod install again and since then it started giving me this error. Somewhere some setting or some version is causing this to fail. – Abhilash Bhargava Oct 20 '19 at 09:09
  • https://stackoverflow.com/questions/53289524/xcode-10-2-1-command-phasescriptexecution-failed-with-a-nonzero-exit-code/60090102#60090102 – Anurag Sharma Feb 06 '20 at 08:07
  • @AnuragSharma I tried the link u posted and what not how did u solved this issue . – iMinion Jun 16 '20 at 13:27
  • @iMinion, I only check-marked the Run script and show environment option, You can get that by following the answer in that link. It worked what issue you are facing? – Anurag Sharma Jun 17 '20 at 07:56
  • @AnuragSharma I m getting [31merror: Unable to read Google Service plist at path /Users//Desktop/AppName/GoogleService-Info.plist[0m Command PhaseScriptExecution failed with a nonzero exit code when I archive. my app – iMinion Jun 17 '20 at 09:20
  • @iMinion, Can you remove the google plist file and add that again? Then check is it working fine or not – Anurag Sharma Jun 17 '20 at 10:14
  • @AnuragSharma done that bro but no luck – iMinion Jun 17 '20 at 10:26
  • @iMinion, Are you sure about the name and path of the google plist file ?, Can you check this link https://stackoverflow.com/questions/58170983/archive-fails-with-error-archive-unable-to-read-googleservice-info-plist-at-path – Anurag Sharma Jun 17 '20 at 10:38
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/216127/discussion-between-iminion-and-anurag-sharma). – iMinion Jun 17 '20 at 10:47

4 Answers4

0

Make sure you have installed your pods correctly. For me I removed all the pods from my pod file, updated the pod through the terminal, then re-added the pods to the pod file and installed through the terminal. This worked perfectly for me.

0

I had the same exact problem. What worked for me was I opened the podifle and deleted all the pods, then saved it. After that run pod update in terminal. Go back to the podfile and past the pods back into the file and save it. Then run pod update in terminal again. After that open xcode and run the cleaner and then try to Archive...it worked for me.

0

Based on the previous answers, the following worked for me:

  1. Quit XCode.
  2. Delete all relevant files: Podfile, Podfile.lok, Pods folder and .workspace file.
  3. Recreate the Podfile and open the new .workspace file.

Cheers

PS: In my case, I hit this issue after copying an existing project (workspace) to a new machine.

Peter
  • 311
  • 1
  • 9
0

Try go to accounts and press download manual profilesenter image description here