Skip to content

Android build fails: ReactTextShadowNode & ReactTextViewManager are final in latest React Native #76

@alham0046

Description

@alham0046

Issue Description
Hi, I’m getting a build failure when running npm run android in a React Native project that uses react-native-animateable-text. The Android build crashes with the following errors:

error: cannot inherit from final ReactTextShadowNode
error: cannot inherit from final ReactTextViewManager
error: createShadowNodeInstance(...) overridden method is final

Error Log (full)

> Task :react-native-animateable-text:compileDebugJavaWithJavac FAILED
F:\rnprojects\testtveventhandler\node_modules\react-native-animateable-text\android\src\main\java\com\reactnativereanimatedtext\JBTextShadowNode.java:17: error: cannot inherit from final ReactTextShadowNode
public class JBTextShadowNode extends ReactTextShadowNode {
                                      ^
F:\rnprojects\testtveventhandler\node_modules\react-native-animateable-text\android\src\main\java\com\reactnativereanimatedtext\JBTextViewManager.java:16: error: cannot inherit from final ReactTextViewManager
  extends ReactTextViewManager {
          ^
F:\rnprojects\testtveventhandler\node_modules\react-native-animateable-text\android\src\main\java\com\reactnativereanimatedtext\JBTextViewManager.java:31: error: createShadowNodeInstance(...) overridden method is final
  public JBTextShadowNode createShadowNodeInstance(
                          ^
3 errors

Cause

Starting in React Native 0.72+, the underlying classes:

ReactTextShadowNode
ReactTextViewManager

were changed to final in the new Fabric & Paper architecture migration. Because of that, this library’s Android code attempts to extend these classes, which is no longer allowed. So RN marks them as:

final class ReactTextShadowNode
final class ReactTextViewManager
final createShadowNodeInstance()

This makes the library incompatible with the latest RN versions.

Environment

  • react-native-animateable-text version: 0.17.1
  • react : 19.1.0
  • React Native Tvos version: 0.81.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions