question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android NDK issue while upgrading from 0.66.4 to 0.68.1

See original GitHub issue

New 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:open
  • Created a year ago
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
MichDrebycommented, Jun 1, 2022

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:

Task :app:processDebugGoogleServices Execution optimizations have been disabled for task ‘:app:processDebugGoogleServices’ to ensure correctness due to the following reasons:

  • Gradle detected a problem with the following location: ‘/Users/mikhail_dziarbeyeu/Desktop/h3-fe-consumer/android/app/build/generated/res/google-services/debug’. Reason: Task ‘:app:generateCodegenSchemaFromJavaScript’ uses this output of task ‘:app:processDebugGoogleServices’ without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.3/userguide/validation_problems.html#implicit_dependency for more details about this problem.

Task :app:configureNdkBuildDebug FAILED C/C++: fcntl(): Bad file descriptor C/C++: /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
C/C++: /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.

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.

  • What went wrong: Execution failed for task ‘:app:configureNdkBuildDebug’.

[CXX1405] error when building with ndkBuild using /Users/mikhail_dziarbeyeu/Desktop/h3-fe-consumer/android/app/src/main/jni/Android.mk: Build command failed. Error while executing process /Users/mikhail_dziarbeyeu/Library/Android/sdk/ndk/21.4.7075529/ndk-build with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=/Users/mikhail_dziarbeyeu/Desktop/h3-fe-consumer/android/app/src/main/jni/Android.mk APP_ABI=armeabi-v7a NDK_ALL_ABIS=armeabi-v7a NDK_DEBUG=1 NDK_OUT=/Users/mikhail_dziarbeyeu/Desktop/h3-fe-consumer/android/app/build/intermediates/cxx/Debug/731j4282/obj NDK_LIBS_OUT=/Users/mikhail_dziarbeyeu/Desktop/h3-fe-consumer/android/app/build/intermediates/cxx/Debug/731j4282/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/mikhail_dziarbeyeu/Desktop/h3-fe-consumer/android/app/build/generated/source PROJECT_BUILD_DIR=/Users/mikhail_dziarbeyeu/Desktop/h3-fe-consumer/android/app/build REACT_ANDROID_DIR=/Users/mikhail_dziarbeyeu/Desktop/h3-fe-consumer/android/…/node_modules/react-native/ReactAndroid REACT_ANDROID_BUILD_DIR=/Users/mikhail_dziarbeyeu/Desktop/h3-fe-consumer/android/…/node_modules/react-native/ReactAndroid/build APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n}

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.

  • Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

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

0reactions
cortinicocommented, Jun 22, 2022

A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 29867 (create_react_co), pid 29473 (com.PROJETC_NAME)`

It seems it’s failing with a segmentation fault. The reasons could be multiple. Could you provide a reproducer of any form?

Read more comments on GitHub >

github_iconTop Results From Across the Web

What's New in React Native 0.70 — How to Upgrade and Why ...
The new release enables full CMake support for Android builds, instead of relying on the less common NDK build system.
Read more >
Updating NDK is a completely broken process - Issue Tracker
I got frustrated canceled it started it again. Same thing. This happens almost every time on this machine whenever there is a NDK...
Read more >
react native compilesdkversion is not specified. please add it ...
3' version and I got this error when ı want to relase an apk;. What went wrong: A problem occurred configuring project ':react-native-reanimated'....
Read more >
Setting up the development environment - React Native
Expo is a set of tools built around React Native and, while it has many ... Install the Expo client app on your...
Read more >
Could not resolve com.facebook.react:react-native:0.32.0
When in doubt over my build configuration (package.json, build.gradle on android, podfile or workspace/project settings on iOS), I create a ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found