Skip to content

Refresh Android autolinking cache when the project folder moves - #59506

Open
lazerg wants to merge 1 commit into
react:mainfrom
lazerg:fix/issue-59503-autolinking-moved-project
Open

lazerg wants to merge 1 commit into
react:mainfrom
lazerg:fix/issue-59503-autolinking-moved-project

Conversation

@lazerg

@lazerg lazerg commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Summary:

The settings plugin caches autolinking.json with absolute paths and only regenerates it when a lockfile changes or the cache is empty/invalid. Moving or copying the project keeps the lockfile hashes the same, so the next build still links every library from the old folder (and fails if that folder is gone).

isCacheDirty now also treats the cache as dirty when the cached project.android.sourceDir isn't the Gradle root directory of the build being configured, so the config command reruns after a move.

Fixes #59503

Changelog:

[ANDROID] [FIXED] - Refresh the autolinking cache when the project folder is moved or copied

Test Plan:

Added checkAndUpdateConfigIfCachedConfigIsFromAnotherProjectDir to ReactSettingsExtensionTest, which fails before this change and passes after it. ./gradlew :settings-plugin:test in packages/gradle-plugin passes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 26, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Oct 26, 2026
@github-actions

Copy link
Copy Markdown

Visual regression

No visual differences at 3a61c2c63a2b.

ios: no capture

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Android autolinking keeps a project's old paths after the project folder moves

1 participant