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
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 70/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- cmake, react-native
- Área
- build-system
Línea de trabajo
Abre ReactAndroid/cmake-utils/ReactNative-application.cmake y localiza el bloque foreach(autolinked_library ...) alrededor de la línea 97 (0.88.1) / 108 (nightly), junto con el enlace ${APP_CODEGEN_TARGET} justo debajo. Ambos usan la forma simple target_link_libraries, que entra en conflicto con las bibliotecas que se enlazan a sí mismas mediante PRIVATE/PUBLIC. Lee modules/keyword-linking/android/CMakeLists.txt del repositorio del reproductor para ver la combinación que falla y luego ejecuta ./reproduce.sh en el reproductor para confirmar el error de configuración antes de editar. Está terminado cuando el bucle usa una firma con palabras clave de forma consistente y ./gradlew :app:configureCMakeDebug[arm64-v8a] termina con código 0, mientras una biblioteca que no enlaza nada o enlaza de forma simple sigue configurándose.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
ReactNative-application.cmake links every autolinked library to common_flags with the plain signature:
foreach(autolinked_library ${AUTOLINKED_LIBRARIES})
target_link_libraries(${autolinked_library} common_flags)
endforeach()
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.ReproducerAppdepends on a local library,modules/keyword-linking, whosereact-native.config.jsgives AndroidlibraryName: 'keywordlinking'andcmakeListsPath: 'CMakeLists.txt', and whoseandroid/CMakeLists.txtis:add_library(react_codegen_keywordlinking SHARED keyword-linking.cpp) target_link_libraries(react_codegen_keywordlinking PRIVATE fbjni jsi reactnative) -
The script runs
npm install, then./gradlew :app:configureCMakeDebug[arm64-v8a] -PreactNativeArchitectures=arm64-v8ainReproducerApp/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 Version
0.88.1
Affected Platforms
Runtime - Android, Build - Windows
Output of npx @react-native-community/cli info
System:
OS: Windows 11 10.0.26300
CPU: "(32) x64 AMD Ryzen 9 9950X3D 16-Core Processor "
Binaries:
Node:
version: 26.12.1
npm:
version: 12.2.1
Languages:
Java:
version: 17.0.20.1
npmPackages:
"@react-native-community/cli":
installed: 20.2.0
wanted: 20.2.0
react:
installed: 19.3.0
wanted: 19.3.0
react-native:
installed: 0.88.1
wanted: 0.88.1
Android:
hermesEnabled: true
newArchEnabled: true
Stacktrace or Logs
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)
MANDATORY Reproducer
https://github.com/YevheniiKotyrlo/react-native-autolinked-keyword-link-signature
Screenshots and Videos
No response
- Lenguaje dominante
- C++
- Estrellas
- 127k
- Forks
- 25.5k
- Merge medio
- 4 d 47 min
- PR fusionados (30 d)
- 217
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de react/react-native
-
ConcreteShadowNode::getConcreteSharedProps() returns a reference to a temporaryPosiblemente ocupada @lazerg la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
react/react-native#59944 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
`yarn test-ios` exits before building RNTester: `objc-test.sh` launches the WebSocket server script #59433 deletedPosiblemente ocupada @lazerg la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
react/react-native#59939 ·
Los mantenedores suelen responder en 2 días
-
iOS Fabric pointer-handler reset leaves the next lone touch non-primaryPosiblemente ocupada @alleneubank la tomó hace 3 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
react/react-native#59919 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
react/react-native#59722 ·
Los mantenedores suelen responder en 2 días
-
Android: new WebSocket() crashes the app for a URL that OkHttp or java.net.URI rejectsPosiblemente ocupada @sorinc03 la tomó hace 11 días. Abierto🌐Networking Needs: Author Feedback Needs: Repro Platform: Android
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
react/react-native#59704 · 1 comentario ·
Los mantenedores suelen responder en 2 días
Todos los issues de react/react-native
Issues similares
-
Favicons are coolAbiertoenhancement frontend
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
-
Spot Capacity Round Trips tests accept the two largest rising runsPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
intel/torch-xpu-ops#6197 ·
Los mantenedores suelen responder en 1 día
-
project: hipblaslt
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
ROCm/rocm-libraries#15746 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día