Skip to content

Conversation

@hannojg
Copy link
Member

@hannojg hannojg commented Jul 28, 2025

Basically addresses all bugs such as:

Details:

There is a bug with the gradle android plugin that causes libraries that depend on the prefab we publish to not be able to find the native libraries.

There are two problems to why this bug occurs:

  1. The prefabConfigurePackage task might run before we build our native libaries. This will cause AGP to treat our library as a "header only" library, in that case it generates a CMake file, which doesn't include the native library and thus linking fails.
    • Special note: the AGP always creates a header publication file when we run configureCMake,there is no way to avoid that.
  2. There are cases where AGP for a dependent library already ran the prefab CLI when for this library we only had the header publication.
    Even when the publication in our library changes (because native libs were build) the dependent library wouldn't pick up on that change, as the only place where the AGP would re-run the prefab CLI (which generates the cmake file) is here.
    However, no changes are detected, although our prefab publication changed. Thus we manually touch a file to mark it as changed, and that will trigger the CLI to run

Notes:

  • This fix needs to be cherry-picked to v2 of RNWC as well (not sure though how many people use it)
  • Other libraries that use prefab mechanisms such as nitro-modules have to implement this as well

@hannojg hannojg force-pushed the fix/gradle-prefab-issue-undefined-symbol-lld branch from 8ebb5f6 to 3127390 Compare July 28, 2025 11:00
@hannojg hannojg requested a review from mrousavy July 28, 2025 11:00
@mrousavy mrousavy merged commit 31bd374 into main Jul 28, 2025
4 checks passed
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.

3 participants