I have created a new flutter project on Android studio. When I try to run it on emulator it works fine, but when I run it on my iphone it gives this error:
Command PhaseScriptExecution failed with a nonzero exit code
When I check the "For install builds only" checkbox in the Target>Build Phases>Run Scripts, it gives another error
'Flutter/Flutter.h' file not found
I have tried deleting and recreating the ios directory, but no luck.
Below is flutter doctor output
First of all, you need to uncheck "For install builds only" back. Then all you need to do is make sure that your MacBook and your iPhone are on the same apple id.
Furthermore, just make sure you also trust your developer account. For that Go to your Iphone Settings -> General -> Device Management and "trust" yourself as developer.
Now try running on your physical device (iPhone)
Answered By – Taha Asif
Answer Checked By – Dawn Plyler (FlutterFixes Volunteer)