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

Error: Multiple Commands Produce When Archiving Build After Adding Notification Service Extension Target #16818

Open
1 task done
Shatha-Naami opened this issue Dec 4, 2024 · 7 comments
Labels
blocked: customer-response Waiting for customer response, e.g. more information was requested. platform: ios Issues / PRs which are specifically for iOS. plugin: messaging type: bug Something isn't working

Comments

@Shatha-Naami
Copy link

Is there an existing issue for this?

  • I have searched the existing issues.

Which plugins are affected?

Messaging

Which platforms are affected?

No response

Description

Steps to reproduce

  1. I followed the steps in the Firebase documentation: [Display Images in Notifications on iOS].

  2. I ran the app on the simulator, and everything worked correctly, including receiving notifications with images.

  3. However, when I tried to archive the build to create an IPA, the process failed, returning the following error:

    Error:

    Error (Xcode): Multiple commands produce
    '/Users/<user>/Library/Developer/Xcode/DerivedData/Runner-<hash>/Build/Intermediates.noindex/ArchiveIntermediates/<target>/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GoogleUtilities.framework'
    
    Error (Xcode): Multiple commands produce
    '/Users/<user>/Library/Developer/Xcode/DerivedData/Runner-<hash>/Build/Intermediates.noindex/ArchiveIntermediates/<target>/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GoogleUtilities_Privacy.bundle'
    
    Encountered error while archiving for device.
    

    I did not modify any code related to the iOS configuration after adding the Notification Service Extension.

image image

Expected results

Successfully archive the iOS build and generate the IPA file without encountering any errors.

Actual results

Archiving fails with the following errors:

Error (Xcode): Multiple commands produce
'/Users/<user>/Library/Developer/Xcode/DerivedData/Runner-<hash>/Build/Intermediates.noindex/ArchiveIntermediates/<target>/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GoogleUtilities.framework'

Error (Xcode): Multiple commands produce
'/Users/<user>/Library/Developer/Xcode/DerivedData/Runner-<hash>/Build/Intermediates.noindex/ArchiveIntermediates/<target>/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/GoogleUtilities_Privacy.bundle'

Encountered error while archiving for the device.

Code sample

Code sample
import UserNotifications
import FirebaseMessaging

class NotificationService: UNNotificationServiceExtension {
    var contentHandler: ((UNNotificationContent) -> Void)?
    var bestAttemptContent: UNMutableNotificationContent?
    
    override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
        self.contentHandler = contentHandler
        self.bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent)
        guard let bestAttemptContent = bestAttemptContent else {
            contentHandler(request.content)
            return
        }
        // Modify the notification content here...
        Messaging.serviceExtension().populateNotificationContent(bestAttemptContent, withContentHandler: 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 {
            contentHandler(bestAttemptContent)
        }
    }
}

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.22.2, on macOS 14.5 23F79 darwin-arm64, locale en-EG)
    • Flutter version 3.22.2 on channel stable at path_to/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 761747bfc5 (6 months ago), 2024-06-05 22:15:13 +0200
    • Engine revision edd8546116
    • Dart version 3.4.3
    • DevTools version 2.34.3

Reproducing the issue

Screenshots or Video

Screenshots / Video demonstration image

Firebase Core version

3.7.0

Flutter Version

3.22.2

Relevant Log Output

No response

Flutter dependencies

Expand Flutter dependencies snippet
Replace this line with the contents of your `flutter pub deps -- --style=compact`.

Additional context and comments

No response

@Shatha-Naami Shatha-Naami added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Dec 4, 2024
@SelaseKay
Copy link
Contributor

Hi @Shatha-Naami, try running the commands below to see if it resolves your issue.

flutter clean
cd ios
pod deintegrate
pod install

@SelaseKay SelaseKay added the blocked: customer-response Waiting for customer response, e.g. more information was requested. label Dec 4, 2024
@Shatha-Naami
Copy link
Author

Hi @Shatha-Naami, try running the commands below to see if it resolves your issue.

flutter clean
cd ios
pod deintegrate
pod install

Hi @SelaseKay, I tried your solution but still failed.

Also, I have already tried other solutions and followed the steps provided, but unfortunately, it still hasn't worked.

image

@google-oss-bot google-oss-bot removed the blocked: customer-response Waiting for customer response, e.g. more information was requested. label Dec 5, 2024
@SelaseKay SelaseKay added plugin: messaging platform: ios Issues / PRs which are specifically for iOS. labels Dec 5, 2024
@SelaseKay
Copy link
Contributor

It appears the error message has changed. Can you try this:

cd ios
xcodebuild clean
xcodebuild build

@SelaseKay SelaseKay added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. labels Dec 5, 2024
@Shatha-Naami
Copy link
Author

It appears the error message has changed. Can you try this:

cd ios
xcodebuild clean
xcodebuild build

same error.. @SelaseKay

@google-oss-bot google-oss-bot added Needs Attention This issue needs maintainer attention. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels Dec 8, 2024
@blinghartig
Copy link

i have the same problem with notification service target

@krokyze
Copy link

krokyze commented Dec 18, 2024

Fyi. I had the same issue, but it was resolved after I added pod 'GoogleUtilities' to the Podfile for both the Runner target and my notification service extension. However, I’m not entirely sure if that is the right approach.

flutter: 3.24.5
firebase_core: 3.8.1
firebase_crashlytics: 4.2.0
firebase_analytics: 11.3.6
firebase_messaging: 15.1.6
firebase_performance: 0.10.0+11

@SelaseKay
Copy link
Contributor

Hi @Shatha-Naami, could you try @krokyze solution and provide feedback?

@SelaseKay SelaseKay added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. labels Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked: customer-response Waiting for customer response, e.g. more information was requested. platform: ios Issues / PRs which are specifically for iOS. plugin: messaging type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants