Skip to content

Commit e57de5f

Browse files
Kudofacebook-github-bot
authored andcommitted
Fix CI "Build Tests: Android Instrumentation Tests" errors (#31352)
Summary: To fix [the CI error](https://app.circleci.com/pipelines/github/facebook/react-native/8708/workflows/d584348e-941f-4653-96c2-46375894dfaa/jobs/196410) There are two errors: `error: undefined reference to '__android_log_write'` which solved by adding `-llog` linker flag. `ld: error: cannot find -lc++` which workaround by static linking. For the root cause, I am thinking that is after [NDK r19](https://developer.android.com/ndk/guides/other_build_systems), the `-target` should specificy api level. However, buck does not add this accordingly, e.g. `-target armv7-none-linux-androideabi` Given wrong target will make NDK to have `cannot find -lc++` error. The workaround is to use static linking. Since it was an oss_cxx_library, the change should not have impact to Facebook internal testing. ## Changelog [Internal] [Fixed] - Fix CI "Build Tests: Android Instrumentation Tests" errors Pull Request resolved: #31352 Test Plan: Make CI green Reviewed By: JoshuaGross Differential Revision: D27757838 Pulled By: fkgozali fbshipit-source-id: 8f9c80a89c6240938218abacb8a82e3e2e71adbc
1 parent 08ef1df commit e57de5f

File tree

1 file changed

+4
-0
lines changed
  • ReactAndroid/src/main/jni/first-party/fb

1 file changed

+4
-0
lines changed

ReactAndroid/src/main/jni/first-party/fb/BUCK

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,8 @@ oss_cxx_library(
2828
deps = [
2929
JNI_TARGET,
3030
],
31+
linker_flags = [
32+
"-llog",
33+
],
34+
preferred_linkage = "static",
3135
)

0 commit comments

Comments
 (0)