Skip to content

Unresolved reference 'viewModelInstance' on Android with Manual Linking in Decoupled Setup #401

@ranjanj17

Description

@ranjanj17

Description

Hello Rive Team 👋,

I am integrating rive-react-native into a decoupled Android application where the React Native bundle is loaded at runtime. While this setup works perfectly for our iOS app using autolinking, I am facing challenges with the manual linking process required for our Android architecture.

My current approach leads to a build-time dependency issue, and I'm seeking guidance on the correct procedure for manual linking in this environment. I suspect I might be missing a required dependency or a configuration step.

Problem Details

When syncing the project with Gradle after setting up the manual link, the build fails with an Unresolved reference: viewModelInstance error. The IDE cannot locate the necessary import, and I could not find information on this specific dependency in the documentation.

Steps Taken

  1. Installed the library in the React Native module using npm install rive-react-native.
  2. Manually copied the native source code from node_modules/rive-react-native/android/ into my native Android project's app/src/ folder.
  3. Added the native Rive dependency to the app-level build.gradle file. I have tested with multiple versions:
    implementation 'app.rive:rive-android:10.4.1' // Also tried 9.6.5
  4. Attempted to sync the project with Gradle.
  5. Found the issue with the viewModelnstance issue

Expected behavior

It should work as i have manually linked it

Screenshots

  1. Files from the node_module from the react native
Image
  1. issue in the file
Image

Device & Versions (please complete the following information)

Android SDK API Level 35

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions