fix: RNGP trying to configure deleted generated CMake projects when executing cleaning task #54660
+3
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
I noticed that in Reanimated monorepo executing a
cleantask in an example app results in an error due to RNGP trying to configure codegen-generated CMake targets after they have been removed.I think the error happens because
configureReactNativeNdkis called on every task and it indiscriminately changes CMake configs inreact-native/packages/gradle-plugin/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/NdkConfiguratorUtils.kt
Lines 29 to 35 in 87a7796
You can reproduce it with a brand new community CLI app:
npx @react-native-community/cli@latest init --skip-install --install-pods false --version 0.82 App82cd App82yarnyarn add@react-native-community/clipboard` (or any other library with codegen)Build->Clean Projectin Android Studio.Alternatively, after building, you can add the following anywhere in
android/app/build/generated/autolinking/src/main/jni/Android-autolinking.cmakeI think that since the cleanup process can be parallelized
add_subdirectoryfor codegen-generated CMakeLists.txt shouldn't be picked up in the cleaning task.Changelog:
[ANDROID] [FIXED] - RNGP trying to configure deleted generated CMake projects when executing cleaning task
Test Plan:
Applying the fix in a brand-new community CLI app fixes the issue.