-
Notifications
You must be signed in to change notification settings - Fork 37
Description
Summary
Building Android with RN 0.82.1 fails because the package react-native-agora-chat does not provide the expected codegen JNI outputs. The app's generated CMake autolinking file unconditionally adds an add_subdirectory(...) for the package's build/generated/source/codegen/jni/ directory and references ChatSdk codegen symbols, but that folder (and ChatSdk.h) are missing — causing CMake configure / native build to fail.
I implemented a local workaround (stubs) to unblock the build; this is temporary and not a correct upstream fix.
Project specifications (from my environment)
Repo: buddypass-mobile (branch 16kb-bug-fix)
React Native: 0.82.1
react-native-agora-chat: ^1.3.5
Android compileSdk / targetSdk: 36
minSdkVersion: 24
Android NDK: 29.0.13599879
CMake: 3.22.1 (Android CMake)
Gradle / Gradle plugin: Gradle 8.x (build logs from ./gradlew assembleDebug)
OS where build ran: Windows (PowerShell)
Commands used to reproduce: cd android then ./gradlew assembleDebug
Exact failure (key errors)
CMake configure step fails with:
add_subdirectory given source "…/node_modules/react-native-agora-chat/android/build/generated/source/codegen/jni/" which is not an existing directory.
Cannot specify link libraries for target "react_codegen_ChatSdk" which is not built by this project.
During build the compile fails with:
fatal error: 'ChatSdk.h' file not found
Full failing task: :app:configureCMakeDebug[arm64-v8a] -> then :app:buildCMakeDebug[arm64-v8a] fails.
Observed vs expected
Observed: CMake/autolinking expects react-native-agora-chat to provide generated codegen JNI files (headers and CMake targets) but they are absent, causing the native build to fail.
Expected: Either (A) react-native-agora-chat should include codegen outputs (headers + build/generated/source/codegen/jni/ with a valid CMakeLists.txt) so the autolinking step works; or (B) the package should not be added to autolinking CMake when codegen outputs are absent.