Android NDK issue while upgrading from 0.66.4 to 0.68.1
See original GitHub issueNew Version
0.68.1
Old Version
0.66.4
Build Target(s)
Android device in debug and release mode
Output of react-native info
System: OS: macOS 12.3.1 CPU: (8) x64 Apple M1 Pro Memory: 143.27 MB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 16.0.0 - /usr/local/bin/node Yarn: Not Found npm: 7.10.0 - /usr/local/bin/npm Watchman: 2022.03.21.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.3 - /Users/abhishek/.rbenv/shims/pod SDKs: iOS SDK: Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3 Android SDK: Android NDK: 22.1.7171670 IDEs: Android Studio: 2021.1 AI-211.7628.21.2111.8309675 Xcode: 13.2/13C90 - /usr/bin/xcodebuild Languages: Java: 11.0.13 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: ^17.0.2 => 17.0.2 react-native: ^0.68.1 => 0.68.1 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
Issue and Reproduction Steps
[CXX1405] error when building with ndkBuild using /Users/abhishek/PROJECT_NAME/source/PROJECT_NAME-mob/PROJECT_NAME/android/app/src/main/jni/Android.mk: Build command failed.
Error while executing process /Users/abhishek/Library/Android/sdk/ndk/24.0.8215888/ndk-build with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=/Users/abhishek/PROJECT_NAME/source/PROJECT_NAME-mob/PROJECT_NAME/android/app/src/main/jni/Android.mk APP_ABI=x86 NDK_ALL_ABIS=x86 NDK_DEBUG=1 NDK_OUT=/Users/abhishek/PROJECT_NAME/source/PROJECT_NAME-mob/PROJECT_NAME/android/app/build/intermediates/cxx/Debug/3t3w192i/obj NDK_LIBS_OUT=/Users/abhishek/PROJECT_NAME/source/PROJECT_NAME-mob/PROJECT_NAME/android/app/build/intermediates/cxx/Debug/3t3w192i/lib APP_CFLAGS+=-Wall APP_CFLAGS+=-Werror APP_CFLAGS+=-fexceptions APP_CFLAGS+=-frtti APP_CFLAGS+=-DWITH_INSPECTOR=1 APP_CPPFLAGS+=-std=c++17 APP_PLATFORM=android-21 APP_STL=c++_shared NDK_TOOLCHAIN_VERSION=clang GENERATED_SRC_DIR=/Users/abhishek/PROJECT_NAME/source/PROJECT_NAME-mob/PROJECT_NAME/android/app/build/generated/source PROJECT_BUILD_DIR=/Users/abhishek/PROJECT_NAME/source/PROJECT_NAME-mob/PROJECT_NAME/android/app/build REACT_ANDROID_DIR=/Users/abhishek/PROJECT_NAME/source/PROJECT_NAME-mob/PROJECT_NAME/android/…/node_modules/react-native/ReactAndroid REACT_ANDROID_BUILD_DIR=/Users/abhishek/PROJECT_NAME/source/PROJECT_NAME-mob/PROJECT_NAME/android/…/node_modules/react-native/ReactAndroid/build APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n}
Android NDK: ERROR:/Users/abhishek/PROJECT_NAME/source/PROJECT_NAME-mob/PROJECT_NAME/android/app/src/main/jni/Android.mk:fb: LOCAL_SRC_FILES points to a missing file
Android NDK: Check that /Users/abhishek/PROJECT_NAME/source/PROJECT_NAME-mob/PROJECT_NAME/android/app/build/react-ndk/exported/x86/libfb.so exists or that its path is correct
fcntl(): Bad file descriptor /Users/abhishek/Library/Android/sdk/ndk/24.0.8215888/build/core/prebuilt-library.mk:51: *** Android NDK: Aborting . Stop.
Issue Analytics
- State:
- Created a year ago
- Comments:16 (6 by maintainers)
Top GitHub Comments
I’m upgrading react-native from 0.67.2 to 0.68.2 doing diligently steps from the guide https://reactnative.dev/docs/new-architecture-app-intro But now I got stuck with the similar issue as @Abhishek2250 has. My stacktrace:
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use ‘–warning-mode all’ to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.3/userguide/command_line_interface.html#sec:command_line_warnings
Execution optimizations have been disabled for 2 invalid unit(s) of work during this build to ensure correctness. Please consult deprecation warnings for more details. 916 actionable tasks: 10 executed, 906 up-to-date
FAILURE: Build failed with an exception.
fcntl(): Bad file descriptor /Users/mikhail_dziarbeyeu/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module myapplication_appmodules depends on undefined modules: react_codegen_samplelibrary
/Users/mikhail_dziarbeyeu/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies. . Stop.
BUILD FAILED in 51s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
It seems it’s failing with a segmentation fault. The reasons could be multiple. Could you provide a reproducer of any form?