Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RN 68.1 android not running #1483

Closed
ergauravgupta opened this issue Jun 20, 2022 · 10 comments
Closed

RN 68.1 android not running #1483

ergauravgupta opened this issue Jun 20, 2022 · 10 comments
Assignees
Labels
Close when stale This issue is going to be closed when there is no activity for a while Missing info The user didn't precise the problem enough Missing repro This issue need minimum repro scenario

Comments

@ergauravgupta
Copy link

[CXX1405] error when building with ndkBuild using node_modules/react-native-screens/android/src/main/jni/Android.mk: Build command failed.
Error while executing process /Users/mono-hyd-mac-9/Library/Android/sdk/ndk/24.0.8215888/ndk-build with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=/node_modules/react-native-screens/android/src/main/jni/Android.mk APP_ABI=x86_64 NDK_ALL_ABIS=x86_64 NDK_DEBUG=1 NDK_OUT=/node_modules/react-native-screens/android/build/intermediates/cxx/Debug/70547186/obj NDK_LIBS_OUT=/node_modules/react-native-screens/android/build/intermediates/cxx/Debug/70547186/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=android/app/build/generated/source PROJECT_BUILD_DIR=/android/app/build REACT_ANDROID_DIR=/android/../node_modules/react-native/ReactAndroid REACT_ANDROID_BUILD_DIR=/android/../node_modules/react-native/ReactAndroid/build APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n}
Android NDK: ERROR:/node_modules/react-native-screens/android/src/main/jni/Android.mk:fb: LOCAL_SRC_FILES points to a missing file
Android NDK: Check that /android/app/build/react-ndk/exported/x86_64/libfb.so exists or that its path is correct

fcntl(): Bad file descriptor
/Library/Android/sdk/ndk/24.0.8215888/build/core/prebuilt-library.mk:51: *** Android NDK: Aborting . Stop.

@github-actions
Copy link

github-actions bot commented Jun 20, 2022

Hey! 👋

It looks like you've omitted a few important sections from the issue template.

Please complete Description, Steps To Reproduce, Reproduction and Platform sections.

@github-actions github-actions bot added Missing info The user didn't precise the problem enough Missing repro This issue need minimum repro scenario labels Jun 20, 2022
@github-actions
Copy link

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snippet of code, a snack or a link to a GitHub repository that reproduces the problem?

@ergauravgupta ergauravgupta changed the title RN android not running RN 68.1 android not running Jun 20, 2022
@rado196
Copy link

rado196 commented Jul 3, 2022

same here, has anyone solved this issue?

@kkafar
Copy link
Member

kkafar commented Jul 7, 2022

I can not reproduce this issue w/o any reproduction or insights, but I recall coming across this CXX1405 during development. If I remember right, Invalidate caches in Android studio and optionally rm -fr node_modules && yarn install && rm -fr ~/.gradle should help.

If it does not help, please conform to bot's comments so I can have something to begin with.

@kkafar kkafar added the Close when stale This issue is going to be closed when there is no activity for a while label Jul 7, 2022
@kkafar kkafar self-assigned this Jul 7, 2022
@HarshaR1642
Copy link

has anyone solved this issue ??

@github-actions github-actions bot removed the Close when stale This issue is going to be closed when there is no activity for a while label Jul 8, 2022
@kkafar
Copy link
Member

kkafar commented Aug 2, 2022

This response points toward some local misconfiguration. You might want to check it out.

Edit: Actually, thanks to that issue I managed to reproduce it & fix it with suggestion provided there.

Edit your android/gradle.properties file, uncomment this line:

#org.gradle.parallel=true

and set this setting explicitly to false:

org.gradle.parallel=false

Taking a quick peek it looks like this option is set to true even with this line being initially commented out.

Also you should checkout this troubleshooting section in React Native docs

@kkafar kkafar added the Close when stale This issue is going to be closed when there is no activity for a while label Aug 2, 2022
@kkafar
Copy link
Member

kkafar commented Aug 2, 2022

I'm closing this issue, as:

  1. this should resolve your problem
  2. it is not strictly related to react-native-screens

However feel free to re-open / continue the discussion.

@kkafar kkafar closed this as completed Aug 2, 2022
@robinlehrmann
Copy link

Hello :)
unfortunately I get a similar error but instead of missing libfb.so for x86_64 it's missing for x86

The complete error is here:

* What went wrong:
Execution failed for task ':react-native-safe-area-context:configureNdkBuildDebug[x86]'.
> [CXX1405] error when building with ndkBuild using /Users/robin.lehrmann/projects/rave-now/app/node_modules/react-native-safe-area-context/android/src/main/jni/Android.mk: Build command failed.
  Error while executing process /Users/robin.lehrmann/Library/Android/sdk/ndk/21.4.7075529/ndk-build with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=/Users/robin.lehrmann/projects/rave-now/app/node_modules/react-native-safe-area-context/android/src/main/jni/Android.mk APP_ABI=x86 NDK_ALL_ABIS=x86 NDK_DEBUG=1 NDK_OUT=/Users/robin.lehrmann/projects/rave-now/app/node_modules/react-native-safe-area-context/android/build/intermediates/cxx/Debug/3s2l4j1r/obj NDK_LIBS_OUT=/Users/robin.lehrmann/projects/rave-now/app/node_modules/react-native-safe-area-context/android/build/intermediates/cxx/Debug/3s2l4j1r/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/robin.lehrmann/projects/rave-now/app/android/app/build/generated/source PROJECT_BUILD_DIR=/Users/robin.lehrmann/projects/rave-now/app/android/app/build REACT_ANDROID_DIR=/Users/robin.lehrmann/projects/rave-now/app/node_modules/react-native/ReactAndroid REACT_ANDROID_BUILD_DIR=/Users/robin.lehrmann/projects/rave-now/app/node_modules/react-native/ReactAndroid/build APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n}
  Android NDK: ERROR:/Users/robin.lehrmann/projects/rave-now/app/node_modules/react-native-safe-area-context/android/src/main/jni/Android.mk:fb: LOCAL_SRC_FILES points to a missing file
  Android NDK: Check that /Users/robin.lehrmann/projects/rave-now/app/android/app/build/react-ndk/exported/x86/libfb.so exists  or that its path is correct

  fcntl(): Bad file descriptor
  /Users/robin.lehrmann/Library/Android/sdk/ndk/21.4.7075529/build/core/prebuilt-library.mk:45: *** Android NDK: Aborting    .  Stop.

I thought maybe it's because of the the OS. I use MacOS Monterey which only supports 64 bit 🤔 but arm and the others are working... I already followed the hint from #1483 (comment) but it does not work. :(

@mechaadi
Copy link

mechaadi commented Aug 29, 2022

Hello :) unfortunately I get a similar error but instead of missing libfb.so for x86_64 it's missing for x86

The complete error is here:

* What went wrong:
Execution failed for task ':react-native-safe-area-context:configureNdkBuildDebug[x86]'.
> [CXX1405] error when building with ndkBuild using /Users/robin.lehrmann/projects/rave-now/app/node_modules/react-native-safe-area-context/android/src/main/jni/Android.mk: Build command failed.
  Error while executing process /Users/robin.lehrmann/Library/Android/sdk/ndk/21.4.7075529/ndk-build with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=/Users/robin.lehrmann/projects/rave-now/app/node_modules/react-native-safe-area-context/android/src/main/jni/Android.mk APP_ABI=x86 NDK_ALL_ABIS=x86 NDK_DEBUG=1 NDK_OUT=/Users/robin.lehrmann/projects/rave-now/app/node_modules/react-native-safe-area-context/android/build/intermediates/cxx/Debug/3s2l4j1r/obj NDK_LIBS_OUT=/Users/robin.lehrmann/projects/rave-now/app/node_modules/react-native-safe-area-context/android/build/intermediates/cxx/Debug/3s2l4j1r/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/robin.lehrmann/projects/rave-now/app/android/app/build/generated/source PROJECT_BUILD_DIR=/Users/robin.lehrmann/projects/rave-now/app/android/app/build REACT_ANDROID_DIR=/Users/robin.lehrmann/projects/rave-now/app/node_modules/react-native/ReactAndroid REACT_ANDROID_BUILD_DIR=/Users/robin.lehrmann/projects/rave-now/app/node_modules/react-native/ReactAndroid/build APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n}
  Android NDK: ERROR:/Users/robin.lehrmann/projects/rave-now/app/node_modules/react-native-safe-area-context/android/src/main/jni/Android.mk:fb: LOCAL_SRC_FILES points to a missing file
  Android NDK: Check that /Users/robin.lehrmann/projects/rave-now/app/android/app/build/react-ndk/exported/x86/libfb.so exists  or that its path is correct

  fcntl(): Bad file descriptor
  /Users/robin.lehrmann/Library/Android/sdk/ndk/21.4.7075529/build/core/prebuilt-library.mk:45: *** Android NDK: Aborting    .  Stop.

I thought maybe it's because of the the OS. I use MacOS Monterey which only supports 64 bit 🤔 but arm and the others are working... I already followed the hint from #1483 (comment) but it does not work. :(

Same problem here, I am on MacOS Monterey as well, can't build for arm64-v8a also.

> Task :ReactAndroid:hermes-engine:configureCMakeMinSizeRel[x86_64]
C/C++: release|x86_64 :CMake Deprecation Warning at CMakeLists.txt:42 (cmake_policy):
C/C++: release|x86_64 :  The OLD behavior for policy CMP0026 will be removed from a future version
C/C++: release|x86_64 :  of CMake.
C/C++: release|x86_64 :  The cmake-policies(7) manual explains that the OLD behaviors of all
C/C++: release|x86_64 :  policies are deprecated and that a policy should be set to OLD only under
C/C++: release|x86_64 :  specific short-term circumstances.  Projects should be ported to the NEW
C/C++: release|x86_64 :  behavior and not rely on setting a policy to OLD.

> Task :react-native-gesture-handler:configureNdkBuildDebug[arm64-v8a] FAILED
C/C++: fcntl(): Bad file descriptor
C/C++: /Users/mechaadi/Library/Android/sdk/ndk/21.4.7075529/build/core/prebuilt-library.mk:45: *** Android NDK: Aborting    .  Stop.

@kkafar
Copy link
Member

kkafar commented Sep 10, 2022

I believe this is due to some misconfiguration of task dependencies in react native gradle plugin (files are required before they re build). Workaround for now: run the Android build twice from Android studio. Gradle Sync && first build will fail, but required files will be build so that following builds should succeed.

Edit: you should also consider using more recent React Native version (0.70 or 0.69 at least) as Fabric development at React Native comes with some breaking/big changes in recent versions and many libraries (including react-native-screens) do not strive to keep backward compatibility yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Close when stale This issue is going to be closed when there is no activity for a while Missing info The user didn't precise the problem enough Missing repro This issue need minimum repro scenario
Projects
None yet
Development

No branches or pull requests

6 participants