I am trying to run my application on my iPhone and receiving the following error. It is working fine on Simulator and release builds are also getting built.
error build: Build input file cannot be found: '/Users/username/Library/Developer/Xcode/DerivedData/appname-ejkeyxidrdwrgyctzidcxyrfemfc/Build/Products/Debug-iphoneos/OneSignalNotificationServiceExtension.appex/OneSignalNotificationServiceExtension'. Did you forget to declare this file as an output of a script phase or custom build rule which produces it?
Found the solution refer to this link https://stackoverflow.com/questions/74290242/xcode-error-build-failed-while-building-on-iphone/75266833#75266833