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

Build linker error: libglog.so: error adding symbols: File in wrong format #157

Open
reinismu opened this issue Jan 4, 2023 · 1 comment

Comments

@reinismu
Copy link
Contributor

reinismu commented Jan 4, 2023

I have a hard time figuring out what exactly I have missing

Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':react-native-v8:buildCMakeDebug[arm64-v8a][v8executor]'.
> Build command failed.
  Error while executing process /home/user/Android/Sdk/cmake/3.18.1/bin/ninja with arguments {-C /home/usermobile-app/node_modules/react-native-v8/android/.cxx/Debug/60425s2v/arm64-v8a v8executor}
  ninja: Entering directory `/home/usermobile-app/node_modules/react-native-v8/android/.cxx/Debug/60425s2v/arm64-v8a'
  [1/2] Building CXX object CMakeFiles/v8executor.dir/src/main/cpp/OnLoad.cpp.o
  [2/2] Linking CXX shared library ../../../../build/intermediates/cxx/Debug/60425s2v/obj/arm64-v8a/libv8executor.so
  FAILED: ../../../../build/intermediates/cxx/Debug/60425s2v/obj/arm64-v8a/libv8executor.so 
  : && /home/user/Android/Sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=aarch64-none-linux-android21 --gcc-toolchain=/home/user/Android/Sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64 --sysroot=/home/user/Android/Sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/sysroot -fPIC -DFOLLY_NO_CONFIG=1 -DFOLLY_HAVE_CLOCK_GETTIME=1 -DFOLLY_HAVE_MEMRCHR=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_MOBILE=1 -DREACT_NATIVE_TARGET_VERSION=70 -fexceptions -fno-omit-frame-pointer -frtti -Wno-sign-compare -DV8_COMPRESS_POINTERS -O0 -fno-limit-debug-info  -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libgcc_real.a -Wl,--exclude-libs,libatomic.a -Wl,--build-id -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -shared -Wl,-soname,libv8executor.so -o ../../../../build/intermediates/cxx/Debug/60425s2v/obj/arm64-v8a/libv8executor.so CMakeFiles/v8executor.dir/home/usermobile-app/node_modules/react-native-v8/src/v8runtime/HostProxy.cpp.o CMakeFiles/v8executor.dir/home/usermobile-app/node_modules/react-native-v8/src/v8runtime/JSIV8ValueConverter.cpp.o CMakeFiles/v8executor.dir/home/usermobile-app/node_modules/react-native-v8/src/v8runtime/V8Inspector.cpp.o CMakeFiles/v8executor.dir/home/usermobile-app/node_modules/react-native-v8/src/v8runtime/V8PointerValue.cpp.o CMakeFiles/v8executor.dir/home/usermobile-app/node_modules/react-native-v8/src/v8runtime/V8Runtime.cpp.o CMakeFiles/v8executor.dir/home/usermobile-app/node_modules/react-native-v8/src/v8runtime/V8RuntimeFactory.cpp.o CMakeFiles/v8executor.dir/src/main/cpp/V8ExecutorFactory.cpp.o CMakeFiles/v8executor.dir/src/main/cpp/OnLoad.cpp.o  /home/user/Android/Sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/21/liblog.so  ../../../../build/jniLibs/react/jni/arm64-v8a/libjsi.so  ../../../../build/jniLibs/react/jni/arm64-v8a/libjsinspector.so  /usr/lib/libglog.so  ../../../../build/jniLibs/react/jni/arm64-v8a/libfbjni.so  ../../../../build/jniLibs/react/jni/arm64-v8a/libfolly_runtime.so  ../../../../build/jniLibs/react/jni/arm64-v8a/libreactnativejni.so  ../../../../build/jniLibs/react/jni/arm64-v8a/libruntimeexecutor.so  ../../../../build/jniLibs/v8/jni/arm64-v8a/libv8android.so  libreactnative_internal_static.a  -landroid  ../../../../build/jniLibs/react/jni/arm64-v8a/libfolly_runtime.so  -latomic -lm && :
  /usr/lib/libglog.so: error adding symbols: File in wrong format
  clang++: error: linker command failed with exit code 1 (use -v to see invocation)
  ninja: build stopped: subcommand failed.
@reinismu
Copy link
Contributor Author

reinismu commented Jan 5, 2023

Did a bit of investigation. I have google-glog installed on my linux. So build tools pick it /usr/lib/libglog.so over ../../../../build/jniLibs/react/jni/arm64-v8a/libglog.so

Will need to think about what I can do in this case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant