Fix Android native math library linkage#211
Open
geirsagberg wants to merge 1 commit into
Open
Conversation
Author
|
Here are simulator setup details that reproduce this without a physical device. Environment
I used an AVD named $ANDROID_SDK_ROOT/emulator/emulator @Medium_Phone_API_36.1 \
-no-window \
-no-audio \
-no-boot-anim \
-gpu swiftshader_indirect \
-no-snapshotMinimal instrumentation test@RunWith(AndroidJUnit4::class)
class H3AndroidIntegrationTest {
@Test
fun loadsNativeH3() {
val h3 = H3Core.newSystemInstance()
val cell = h3.latLngToCell(59.9109, 10.7522, 12)
assertEquals(0x08c09993866141ffL, cell)
assertTrue(h3.cellToBoundary(cell).size >= 5)
}
}Run it with the emulator serial selected: ANDROID_SERIAL=emulator-5554 ./gradlew connectedDebugAndroidTestWith the published 4.4.0 AAR, this deterministically fails during I rebuilt the ARM64 AAR with this PR, installed it into the same test app, and reran the unchanged instrumentation test on the same AVD. It passes.
|
dfellis
approved these changes
Jul 12, 2026
Coverage Report for CI Build 649Coverage remained the same at 96.954%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
libmexplicitly when buildinglibh3-java.sofor Androidfind_librarybehavior on other platformslibm.soFixes #206.
Reproduction
Using
com.uber:h3-android:4.4.0on an Android 16 ARM64 emulator,H3Core.newSystemInstance()failed with:The published library's dynamic section declared
liblog.so,libdl.so, andlibc.so, but notlibm.so.Verification
readelf -dincludesNEEDED Shared library: [libm.so]./gradlew spotlessCheck compileJava