rive-app / rive-app/rive-android

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

Open
#401 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

triage
Dominant language
Kotlin
Stars
538
Forks
66
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the manually copied sources under node_modules/rive-react-native/android/ and the corresponding files in app/src/, focusing on the unresolved viewModelInstance reference. Review the app-level build.gradle dependency and compare it with the native source requirements, then run a Gradle sync; done means the Android project builds successfully with the manual link.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
build-system, mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.