Skip to content

Nitro HybridView "View config getter callback" error on Expo (Android) #1063

@mckenytech

Description

@mckenytech

I'm using Nitro Modules in an Expo project (SDK 54, RN 0.81.5, react-native-nitro-modules ^0.31.10).

  • HybridObjects work perfectly ✅ - I can call C++ methods like HybridMathC.add(5, 3) and get results.
  • HybridView (GameView) does NOT work ❌ - When I try to render a Nitro View, I get:
    Invariant Violation: View config getter callback for component `GameView` must be a function (received `undefined`).
    

And sometimes:

Tried to register two views with the same name GameView

My setup:

  • GameView.nitro.ts spec with HybridView<GameViewProps, GameViewMethods>
  • HybridGameViewView.kt implementing HybridGameViewSpec
  • View manager registered in NitroRegameModulePackage.createViewManagers()
  • getHostComponent('GameView', () => GameViewConfig) in TypeScript

What I've tried:

  • Following official react-native-nitro-test package pattern exactly
  • Using require() and ES6 import for the JSON config
  • Adding @keep and @DoNotStrip annotations

Is Nitro HybridView compatible with Expo's Fabric setup? Or is there additional configuration needed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions