Skip to content

fix: drop NitroModules qualifiers in Fs2Stream.swift - #143

Merged
iBotPeaches merged 2 commits into
masterfrom
fix/ios-release-nitro-qualifiers
Sep 15, 2026
Merged

iBotPeaches merged 2 commits into
masterfrom
fix/ios-release-nitro-qualifiers

Conversation

@ian-wd

@ian-wd ian-wd commented Sep 15, 2026

Copy link
Copy Markdown

Problem

iOS Release builds fail to compile ios/Fs2Stream.swift:

Fs2Stream.swift:693:59: error: 'ArrayBuffer' is not a member type of enum '__ObjC.NitroModules'
Fs2Stream.swift:682:68: error: 'Promise' is unavailable: Un-specialized class templates are not currently supported.
Fs2Stream.swift:4:7: error: type 'Fs2Stream' does not conform to protocol 'HybridFs2StreamSpec_protocol'

The RNFS2 pod compiles Swift with C++ interop. In Release (whole-module) builds, NitroModules-Swift.h is pulled into the Swift compile, and its C++ namespace NitroModules is imported as enum __ObjC.NitroModules. That shadows the Swift module of the same name, so NitroModules.Promise resolves to the unavailable C++ class template and NitroModules.ArrayBuffer does not resolve at all. Debug builds are unaffected.

Fix

Use the bare Promise / ArrayBuffer names (14 references), matching the nitrogen-generated HybridFs2StreamSpec.swift and the other Swift sources (Fs2.swift, Downloader.swift, MediaStore.swift).

Verification

Xcode 26.4.1, example app Pods:

xcodebuild -project Pods/Pods.xcodeproj -target RNFS2 -configuration Release -sdk iphonesimulator CODE_SIGNING_ALLOWED=NO build
  • Before: exit 65, same errors as above
  • After: BUILD SUCCEEDED, 0 errors

Also confirmed downstream on Xcode 26.5 (Release + iphoneos archive).

CI does not build iOS, so this class of failure is not caught today.

@iBotPeaches
iBotPeaches enabled auto-merge (squash) September 15, 2026 12:45
@iBotPeaches
iBotPeaches merged commit 56ffd1e into master Sep 15, 2026
2 checks passed
@iBotPeaches
iBotPeaches deleted the fix/ios-release-nitro-qualifiers branch September 15, 2026 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants