Fix CI "Build Tests: Android Instrumentation Tests" errors #31352
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
To fix the CI error
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,
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
Test Plan
Make CI green