Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Xcode: Error Build failed while building on iPhone #1446

Closed
2 of 3 tasks
tragicmj opened this issue Nov 3, 2022 · 9 comments
Closed
2 of 3 tasks

[Bug]: Xcode: Error Build failed while building on iPhone #1446

tragicmj opened this issue Nov 3, 2022 · 9 comments

Comments

@tragicmj
Copy link

tragicmj commented Nov 3, 2022

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

Screenshot 2022-11-03 at 11 26 31 AM

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?

  • 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

  • I agree to follow this project's Code of Conduct
@0xJoelero
Copy link

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?

@marcusjribeiro
Copy link

same here 😢 😞

@hinh-eoh
Copy link

same here

@0xJoelero
Copy link

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)

Screenshot 2022-12-15 at 13 49 19

  • also update the OneSignal version on your Podfile
    pod 'OneSignalXCFramework', '>= 3.11.2', '< 4.0'

@HuriHuchi
Copy link

same issue 😭

@HuriHuchi
Copy link

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)

Screenshot 2022-12-22 at 12 53 19 AM

@tragicmj
Copy link
Author

Yes, this works, thank you

@yosukapro
Copy link

You save my days @HuriHuchi

@hashimalikhan-123
Copy link

hashimalikhan-123 commented Jul 11, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants