Skip to content

Conversation

@mrousavy
Copy link
Owner

@mrousavy mrousavy commented Jul 25, 2025

A super long standing issue in native dependencies of native dependencies (e.g. VisionCamera -> Worklets, or NitroImage -> Nitro) was that the second native dependency's symbols can no longer be linked after some time. E.g. after gradle syncs, or another npm install.

Apparently the guys at SWM found a fix for this (so huge shoutout to @tomekzaw!), and this needs to be applied to all third party dependencies.

@vercel
Copy link

vercel bot commented Jul 25, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nitro-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 25, 2025 10:23am

@tomekzaw
Copy link

tomekzaw commented Jul 25, 2025

Hey, thanks for the shoutout as well as mentioning the source of the workaround – we really appreciate this! ❤️

While this approach indeed fixes the issue, it's far from ideal, as it basically runs the build process during Gradle sync and it takes plenty of time for a thing that should take at most seconds.

The same issue appeared in Reanimated (after we moved Worklets to a separate dependency). I've tried to apply the very same approach in software-mansion/react-native-reanimated#7781 but noticed that with the change Gradle sync takes couple of minutes which is unacceptable.

@lukmccall pointed out that prefab is supposed to be used to link prebuilds rather than for building the dependencies from source. He also suggested that we should avoid using prefab in favor of "manual" linking. We've submitted another draft PR that does exactly that: software-mansion/react-native-reanimated#7866 Now we just need to declare a dependency between build tasks (so that Reanimated is built after Worklets) and perhaps find a better way to obtain the path for libworklets.so in debug/release mode once it's properly stripped etc.

@mrousavy
Copy link
Owner Author

nvm we fixed this with this: 92abaaa

@mrousavy mrousavy closed this Jul 31, 2025
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.

Android: Cache issue when rebuilding, need to clear cache to fix

3 participants