You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ReactNative-application.cmake links autolinked libraries to common_flags with the plain target_link_libraries signature, so a library that uses PRIVATE fails the app's CMake configure #60000
CMake refuses to mix the plain and the keyword signatures on one target, so an autolinked library whose own CMakeLists.txt links its target with PRIVATE, PUBLIC or INTERFACE fails the configure of every app that installs it. The app-level codegen target is linked the same way (target_link_libraries(${APP_CODEGEN_TARGET} common_flags)).
Steps to reproduce
Clone the reproducer and run ./reproduce.sh (react-native 0.88.1) or ./reproduce.sh nightly. ReproducerApp depends on a local library, modules/keyword-linking, whose react-native.config.js gives Android libraryName: 'keywordlinking' and cmakeListsPath: 'CMakeLists.txt', and whose android/CMakeLists.txt is:
The script runs npm install, then ./gradlew :app:configureCMakeDebug[arm64-v8a] -PreactNativeArchitectures=arm64-v8a in ReproducerApp/android.
Expected: the app's CMake build configures, as it does when the library drops PRIVATE.
Seen: the configure fails at ReactNative-application.cmake:97 on 0.88.1 and at :108 on 0.90.0-nightly-20261113-6d587e873. The script exits 1 while this shows and 0 once the configure passes.
react-native 0.90.0-nightly-20261113-6d587e873
$ ./gradlew :app:configureCMakeDebug[arm64-v8a] -PreactNativeArchitectures=arm64-v8a
gradle exit 1
C/C++: CMake Error at ReproducerApp/node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake:108 (target_link_libraries):
C/C++: The keyword signature for target_link_libraries has already been used with
C/C++: the target "react_codegen_keywordlinking". All uses of
C/C++: target_link_libraries with a target must be either all-keyword or
C/C++: all-plain.
C/C++: The uses of the keyword signature are here:
C/C++: * ReproducerApp/node_modules/keyword-linking/android/CMakeLists.txt:7 (target_link_libraries)
C/C++: Call Stack (most recent call first):
C/C++: CMakeLists.txt:31 (include)
SUMMARY: defect: the app's CMake configure fails, as ReactNative-application.cmake links react_codegen_keywordlinking with the plain signature and its own CMakeLists uses PRIVATE (react-native 0.90.0-nightly-20261113-6d587e873)
Activity