Skip to content

fix(ios): Fix iOS build with new architecture enabled#158

Closed
momomuchu wants to merge 1 commit intomrousavy:mainfrom
momomuchu:claude/fix-tflite-ios-build-0131bGtBMVeXk3NSX7Nyf4qn
Closed

fix(ios): Fix iOS build with new architecture enabled#158
momomuchu wants to merge 1 commit intomrousavy:mainfrom
momomuchu:claude/fix-tflite-ios-build-0131bGtBMVeXk3NSX7Nyf4qn

Conversation

@momomuchu
Copy link
Copy Markdown

Fixes issue where iOS build fails with "RNTfliteSpec.h file not found" when React Native new architecture (TurboModules) is enabled.

Changes:

  1. Podspec: Merge pod_target_xcconfig instead of overwriting to preserve TensorFlow Lite settings when new architecture is enabled
  2. Podspec: Add RCT-RCTFabric dependency for Fabric support
  3. Podspec: Remove duplicate CLANG_CXX_LANGUAGE_STANDARD entries
  4. iOS: Update RNTfliteSpec.h import to use correct path format (<RNTfliteSpec/RNTfliteSpec.h> instead of "RNTfliteSpec.h")

The issue was caused by:

  • pod_target_xcconfig being redefined instead of merged, losing TensorFlow Lite preprocessor definitions
  • Incorrect header import path for Codegen-generated spec file

Resolves: #87

Fixes issue where iOS build fails with "RNTfliteSpec.h file not found"
when React Native new architecture (TurboModules) is enabled.

Changes:
1. Podspec: Merge pod_target_xcconfig instead of overwriting to preserve
   TensorFlow Lite settings when new architecture is enabled
2. Podspec: Add RCT-RCTFabric dependency for Fabric support
3. Podspec: Remove duplicate CLANG_CXX_LANGUAGE_STANDARD entries
4. iOS: Update RNTfliteSpec.h import to use correct path format
   (<RNTfliteSpec/RNTfliteSpec.h> instead of "RNTfliteSpec.h")

The issue was caused by:
- pod_target_xcconfig being redefined instead of merged, losing TensorFlow
  Lite preprocessor definitions
- Incorrect header import path for Codegen-generated spec file

Resolves: mrousavy#87
@momomuchu momomuchu changed the title fix: Fix iOS build with new architecture enabled fix(ios): Fix iOS build with new architecture enabled Nov 17, 2025
@momomuchu
Copy link
Copy Markdown
Author

ref issue: #87

@efstathiosntonas
Copy link
Copy Markdown

I think you should also add this:

node_modules/react-native-fast-tflite/ios/Tflite.mm (+1 -1)
    57  {
    58 -    return std::make_shared<facebook::react::NativeTfliteSpecJSI>(params);
    58 +    return std::make_shared<facebook::react::NativeRNTfliteSpecJSI>(params);
    59  }

The TurboModule export now returns facebook::react::NativeRNTfliteSpecJSI, matching the actual JSI class generated in RNTfliteSpec. This resolves the “No member named NativeTfliteSpecJSI” error.

@mrousavy
Copy link
Copy Markdown
Owner

Hi - thanks for the PR - we recently migrated the library to Nitro and upgraded it to latest LiteRT, so I think this PR is quite out of sync now - sorry for not getting it merged sooner.

I'm going to close this for now, but if this is still relevant in the latest version, we can open another PR and get it merged. 👍

@mrousavy mrousavy closed this Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[iOS]: "RNTfliteSpec.h" not found in RN 0.75 with new arch

4 participants