Skip to content

[iOS] Build error on Xcode 26: Use of '@import' when C++ modules are disabled #1

Description

@osamaalghassani

Before submitting a new issue

  • I tested using the latest version of the library, as the bug might be already fixed.
  • I tested using a supported version of react native.
  • I checked for possible duplicate issues, with possible answers.

Bug summary

When building for iOS using the latest Xcode 26 environment (specifically the iPhoneOS26.0.sdk), the build fails during the compilation of MqttClient.mm.

The error occurs because MQTTLog.h (from the underlying MQTTClient pod) uses the @import Foundation; syntax. In a React Native environment where .mm files (Objective-C++) are common, this syntax causes a conflict unless -fcxx-modules is explicitly enabled.

Error Log:
❌ (ios/Pods/Headers/Private/MQTTClient/MQTTLog.h:9:1)

9 | @import Foundation;
| ^ use of '@import' when C++ modules are disabled, consider using -fmodules and -fcxx-modules

Library version

0.3.2

Environment info

The error is reproducible on EAS Build using the macos-sequoia-16 (Xcode 26) worker image.

Steps to reproduce

1-Install @ecodevstack/react-native-mqtt-client in a React Native project.

2-Run an EAS Build

3-Observe the ARCHIVE FAILED error during the RNMqttClient target compilation.

Reproducible example repository

"I don't have a public repository at the moment, but the issue can be reproduced in any React Native project by trying to compile the library using Xcode 26. The error is explicitly located in the library's internal header: Pods/Headers/Private/MQTTClient/MQTTLog.h:9:1. You can verify this by checking the syntax of the @import Foundation; line in a C++ (.mm) compilation context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions