Xcode: Error Build failed while building on iPhone

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?

Answered by javedakhtar432 in 751213022

I am facing the same issue.

error: Build input file cannot be found: '/Users/ask/PT/STRICTLYWORK/X_IOS/app-ios/app-ios-xyz/build/Release-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? (in target 'OneSignalNotificationServiceExtension' from project 'XYZ')

Has anyone figured out the solution? I am using cocoapods, xcode 14.1

Accepted Answer
Xcode: Error Build failed while building on iPhone
 
 
Q