PhaseScriptExecution failed with a nonzero exit code

Hi everyone, I am facing issue with deploying my flutter application on iOS only. The application runs fine on android. When I connect my physical iOS device and hit run (play button) I get a message saying build failed and it says Command PhaseScriptExecution failed with a nonzero exit code. I tried the forums and stackoverflow but none of those solutions worked for me. Any help would be appreciated.
I saw that images are not allowed here, so if needed I would not mind sending any images relating to the issue personally (dm)

11 comments · 84% upvoted · other discussions

comments

Cladser

Does it run on the simulator? I mostly get this when I have a missing semicolon somewhere. Have you checked the issues tab (in Android Studio) ?

Count_Dracula_Jr [OP]

Hi thanks for your reply. No, the app doesn’t run in the simulator also. I use VS Code with flutter and in VS Code I did not get any errors. Also, the app installed and ran as expected on an android device

Cladser

Have you tried using the legacy build settings in Xcode?

Count_Dracula_Jr [OP]

Hello, I’m happy to inform that the app is successful running on iOS as well. I had to check the For Install Builds only under Run Script jn Build phases tab and I was good to go

Cladser

Also... you may have done this already, but just in case.. not sure how it works in VS Code but if you open and build in XCode (not via the VSCode build Command) then if you read up a few lines from the Non Zero exit code error it will usually say where abouts in your code it found the error.

Count_Dracula_Jr [OP]

No, I have not done that yet. I’ll do that and get back to you Also, I can see that if I open the Runner.xcworkspace file on Xcode right?

Count_Dracula_Jr [OP]

Yes, in the build target Runner- Log I read a few lines above and it says Build/Intermediates.noindex/ Not sure if this means anything

Cladser

Not sure either :/ have you ever had this running on iOS? If not check if any of your dependencies need info.plst permissions added. Which might explain why it builds for Android but not iOS.

Count_Dracula_Jr [OP]

What is that? How can I edit that? Please note that I’m fairly new to flutter

Cladser

Sorry just seen this. If you have an packages that use microphone / gps / etc as well as asking for permission you need to put the reason in the info.plist file. The instructions on the package Pub.dev site should say what need changing.

If your new then it’s easiest to do in Xcode. See here

how to edit plist in Xcode

Count_Dracula_Jr [OP]

Thanks, I think we live in different time zones. So we’re seeing messages later. I don’t mind, I want you to respond when you’re free. I will see the link and edit it