66
Views
3
Comments
[Cloud Messaging Plugin (Firebase)] I got an error when built cloud message on iOS
Question
cloud-messaging-plugin-firebase
Mobile icon
Forge asset by OutSystems
Application Type
Mobile

I try to built my mobile application for iOS with MABS8.1 and MABS9.0 and I got the error

Do you know how to  solve this issue?

[2023-08-04T01:06:03.770Z] [VERBOSE] [Build] source/platforms/ios/MYAPPs/Plugins/com.outsystems.firebase.cloudmessaging/AppDelegate+OSFirebaseCloudMessaging.m:2:9: fatal error: 'OutSystems-Swift.h' file not found

[2023-08-04T01:06:03.770Z] [VERBOSE] [Build] #import "OutSystems-Swift.h"

[2023-08-04T01:06:03.770Z] [VERBOSE] [Build]         ^~~~~~~~~~~~~~~~~~~~

[2023-08-04T01:06:03.770Z] [VERBOSE] [Build] 1 error generated.


[2023-08-04T01:06:03.773Z] [VERBOSE] [Build] The following build commands failed:

[2023-08-04T01:06:03.773Z] [VERBOSE] [Build]     CompileC /Users/sandbox02/Library/Developer/Xcode/DerivedData/MYAPPs-hairwhpwqujcaugpypnysjrkcdka/Build/Intermediates.noindex/ArchiveIntermediates/MYAPPs /IntermediateBuildFilesPath/MYAPPs.build/Release-iphoneos/MYAPPs.build/Objects-normal/arm64/AppDelegate+OSFirebaseCloudMessaging.o source/platforms/ios/MYAPPs/Plugins/com.outsystems.firebase.cloudmessaging/AppDelegate+OSFirebaseCloudMessaging.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'MYAPPs' from project 'MYAPPs')

[2023-08-04T01:06:03.773Z] [VERBOSE] [Build] (1 failure)

[2023-08-04T01:06:03.780Z] [VERBOSE] [Build] Command finished with error code 65: xcodebuild -workspace,MYAPPs.xcworkspace,-scheme,MYAPPs,-configuration,Release,-destination,generic/platform=iOS,-archivePath,MYAPPs.xcarchive,archive,SHARED_PRECOMPS_DIR=source/platforms/ios/build/sharedpch,OTHER_CODE_SIGN_FLAGS=--options runtime --keychain "keys/keychain.keychain-db"

UserImage.jpg
ayush jain

does it got resolved? i am facing same issue


UserImage.jpg
Juan Yanez

Still not solved? we have the same issue using mabs 9.0, it didn't compile for iOS

2023-05-02 16-46-00
João Grazina

Hi,

I hit this exact 'OutSystems-Swift.h' file not found error too (in my case it surfaced on the Firebase Analytics plugin, but it's the same root cause and it can land on Cloud Messaging just as easily).

I've had a bit of help from Claude, and managed to wiggle my way out of that mess. When I found this thread I asked it to adjust to other issues like this.

Important note: I tested the original fix exclusive to Firebase Analytics, and it worked. If this fix fails, it's likely either MABS evolved, or the adjustment Claude did for your scenario is not complete. Let me know if that's the case and we can work on it - while I have this project saved.

Here's the full diagnosis and fix (AI generated):

Why it happens — and why it isn't specific to one plugin

Several OutSystems plugins ship an Objective-C CDVPlugin shim that bridges to their Swift implementation by importing the app's generated Swift header:

#import "OutSystems-Swift.h"

That line assumes the app's Swift module is named OutSystems. On current MABS (with Xcode 26.x), the app's Swift module is named after the application instead — e.g. an app called My App - Mobile gets the module My_App___Mobile, so the generated header is My_App___Mobile-Swift.h, not OutSystems-Swift.h. The hard-coded import then points at a header that's never produced:

…/Plugin.m:7:13: fatal error: 'OutSystems-Swift.h' file not found** ARCHIVE FAILED **

It shows up on whichever plugin happens to contain that Objective-C bridge. Some plugin versions are pure Swift (no Obj-C shim → unaffected); others carry the Obj-C bridge (affected). That's why one person sees it on Analytics and another on Cloud Messaging — it's the same defect, just a different file importing OutSystems-Swift.h.

Note the generated -Swift.h aggregates all of the app target's Swift symbols, so a single shim fixes every affected plugin at once.

Fix: a tiny hook plugin that adds an OutSystems-Swift.h shim

The file I uploaded includes 3 files which change the compilation on MABS a tiny bit.

This after_prepare hook scans the iOS source for any file that imports OutSystems-Swift.h and drops a shim header of that name next to each one. A quoted #import searches the including file's own folder first, so the shim is always found, and it forwards to the app's real generated header. Works for Analytics, Cloud Messaging, or any other plugin with this bridge.

How to add it

  • In Service Studio: Data → Resources → Import Resource… and add the zip to the module that holds your Extensibility Configurations.
  • In that module's Extensibility Configurations, reference it:
    {
        "resource": "cordova-plugin-os-swift-header-fix.zip",
        "plugin": {
            "resource": "cordova-plugin-os-swift-header-fix"
        },
        ....
    }

A note for the OutSystems team

The Objective-C bridge in the affected plugins hard-codes #import "OutSystems-Swift.h", which only works when the app's Swift module is literally named OutSystems. Under current MABS the module name follows the app name, so the fallback breaks. Please make the bridge independent of a fixed module name (e.g. import the real -Swift.h, compile plugin Swift into a deterministically named module, or document a supported way to pin the iOS Swift module name). Happy to share build details.

cordova-plugin-os-swift-header-fix.zip
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.