[Bug]: Xcode: Error Build failed while building on iPhone
What happened?
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.
React Native - 0.66.1 React Native One Signal - 4.3.6
Steps to reproduce?
1. Building the app on iPhone
What did you expect to happen?
App to get build in iPhone
React Native OneSignal SDK version
4.3.6
Which platform(s) are affected?
- [X] iOS
- [ ] Android
Relevant log output
error build: Build input file cannot be found: '/Users/mdjavedakhtar/Library/Developer/Xcode/DerivedData/baa-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?
Code of Conduct
- [x] I agree to follow this project's Code of Conduct
same issue here 😢:
error build: Build input file cannot be found: '../ios/DerivedData/Ripio/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?
same here 😢 😞
same here
I found a fix:
-
go to Build Settings > Architectures > Release -> and delete the value inside (eg. if is set with the value arm64, delete it)

-
also update the OneSignal version on your Podfile
pod 'OneSignalXCFramework', '>= 3.11.2', '< 4.0'
same issue 😭
I've solved it!
In my case removing arm64 value from Excluded Architectures > Debug solved the problem. (+ it should be removed from all targets including OnesignalNotificationService)

Yes, this works, thank you
You save my days @HuriHuchi
using latest react native version using one signal 5.0.0 version also tried 5.2.0
target 'OneSignalNotificationServiceExtension' do use_frameworks! pod 'OneSignalXCFramework', '>= 5.0.0', '< 6.0' end
when Add this facing error on ios
Multiple commands produce '/Users/macbookpro/Library/Developer/Xcode/DerivedData/ParkingApp-aajwjhcrauxeikclvpiaqghkmjju/Build/Products/Debug-iphoneos/XCFrameworkIntermediates/OneSignalXCFramework/OneSignal/OneSignalFramework.framework'
notificationServiceCode
import UserNotifications
import OneSignalExtension
class NotificationService: UNNotificationServiceExtension {
var contentHandler: ((UNNotificationContent) -> Void)?
var receivedRequest: UNNotificationRequest!
var bestAttemptContent: UNMutableNotificationContent?
override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
self.receivedRequest = request
self.contentHandler = contentHandler
self.bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent)
if let bestAttemptContent = bestAttemptContent {
/* DEBUGGING: Uncomment the 2 lines below to check this extension is executing
Note, this extension only runs when mutable-content is set
Setting an attachment or action buttons automatically adds this */
// print("Running NotificationServiceExtension")
// bestAttemptContent.body = "[Modified] " + bestAttemptContent.body
OneSignalExtension.didReceiveNotificationExtensionRequest(self.receivedRequest, with: bestAttemptContent, withContentHandler: self.contentHandler)
}
}
override func serviceExtensionTimeWillExpire() {
// Called just before the extension will be terminated by the system.
// Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used.
if let contentHandler = contentHandler, let bestAttemptContent = bestAttemptContent {
OneSignalExtension.serviceExtensionTimeWillExpireRequest(self.receivedRequest, with: self.bestAttemptContent)
contentHandler(bestAttemptContent)
}
}
}
Anyone fixed this?