From 8acef85f118302eb62f359a18396bca61ef08b34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikl=C3=B3s=20Fazekas?= Date: Thu, 30 Apr 2026 13:32:52 +0200 Subject: [PATCH] fix(ios): remove Xcode 26 modulemap stripping workaround MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No longer needed since RiveRuntime XCFramework switched from C++/ObjC++ interop to C/ObjC interop — the generated Swift header no longer contains swift:: namespace types that caused ODR conflicts across Xcode versions. --- RNRive.podspec | 22 ---------------------- example/ios/Podfile | 19 ------------------- 2 files changed, 41 deletions(-) diff --git a/RNRive.podspec b/RNRive.podspec index b706f3ce..d9fc63e3 100644 --- a/RNRive.podspec +++ b/RNRive.podspec @@ -38,28 +38,6 @@ else Pod::UI.puts "@rive-app/react-native: Using experimental Rive runtime backend" end -# Xcode 26 workaround: strip .Swift Clang submodule from RiveRuntime's prebuilt -# modulemaps to prevent ODR conflicts with locally-compiled Swift C++ interop. -# See: https://github.com/rive-app/rive-nitro-react-native/issues/173 -if defined?(Pod::Installer) - module RiveXcode26SwiftModuleFix - def run_podfile_pre_install_hooks - rive_dir = File.join(sandbox.root.to_s, 'RiveRuntime') - if Dir.exist?(rive_dir) - Dir.glob(File.join(rive_dir, '**', 'module.modulemap')).each do |path| - content = File.read(path) - next unless content.include?('RiveRuntime.Swift') - cleaned = content.gsub(/\nmodule RiveRuntime\.Swift \{[^}]*\}\n?/m, "\n") - File.write(path, cleaned) - end - end - super - end - end - - Pod::Installer.prepend(RiveXcode26SwiftModuleFix) -end - Pod::Spec.new do |s| s.name = "RNRive" s.version = package["version"] diff --git a/example/ios/Podfile b/example/ios/Podfile index c5462c08..c04206ab 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -33,24 +33,5 @@ target 'RiveExample' do :mac_catalyst_enabled => false, # :ccache_enabled => true ) - - # Xcode 26 / Swift 6.2 workaround: strip the RiveRuntime.Swift submodule - # from RiveRuntime's modulemaps. Without this, Clang sees two conflicting - # definitions of swift::Optional / swift::String (one from the pre-built - # RiveRuntime XCFramework compiled with Swift 6.1, one from NitroModules - # compiled fresh with Swift 6.2) and fails with ODR "different definitions - # in different modules" errors. - # See: https://github.com/rive-app/rive-nitro-react-native/issues/173 - rive_dir = File.join(installer.sandbox.root.to_s, 'RiveRuntime') - if Dir.exist?(rive_dir) - Dir.glob(File.join(rive_dir, '**', 'module.modulemap')).each do |path| - content = File.read(path) - next unless content.include?('RiveRuntime.Swift') - cleaned = content.gsub(/\nmodule RiveRuntime\.Swift \{[^}]*\}\n?/m, "\n") - File.write(path, cleaned) - puts "[RNRive] Stripped RiveRuntime.Swift submodule from #{path}" - end - end - end end