ankidroid / Anki-Android-Backend

JNI bridge between AnkiDroid and Anki Desktop's rust code
GNU General Public License v3.0
65 stars 24 forks source link

Update NDK to v27, Anki to 24.06.3 #402

Closed voczi closed 4 weeks ago

voczi commented 1 month ago

So there's also this thing about 16 kb page sizes (https://developer.android.com/guide/practices/page-sizes). I have confirmed that I get librsdroid with a 16kb page size, so that should now be fine on the Anki-Android-Backend side: image But I haven't really managed to get an emulator running with a 16kb page size. The one provided by Google seems to still be reporting a 4kb page size for the system, same as the regular Android 15 image? Basically, right now we can't really confirm that it runs as it should in Anki-Android under Android 15 with a 16kb page size (because no such image actually exists). But it does run as it should otherwise.

Regarding the NDK download scripts... These, along with the workflows for building a release, were refactored because the macOS image has an out-of-date NDK for now (26 instead of latest 27). So I basically made sure that in the future, in case Windows/Ubuntu gets an outdated NDK, we can just download the one version we want anyway. I would like to find a way to refactor the NDK versions in the codebase so it's no longer hardcoded. But maybe we'll leave that for another time?

Should fix:

voczi commented 1 month ago

So macOS seems to be having problems with the linker argument.. 🤔 image

voczi commented 1 month ago

macOS builds looking good now, too. image

voczi commented 1 month ago

Never mind, seems like you have to install the "VanillaIceCream 16kb" image instead of the "API 35 16kb" one. image Seems to be running fine in Android 15 16kb. Zipalign confirms a 16kb alignment on the Anki-Android release APKs, too. image

And of course, now we're getting +6MB on the apk (from .rodata in packaged librsdroid.so): image Maybe I can get a pass here, for having improved the binary sizes in the past?

EDIT: Must've been some residual on my system, but I cross-checked the CI artifacts this time instead. So scratch that, the aar file is actually smaller now. image image

voczi commented 1 month ago

If it's not, could we only push forward to 24.06.3

Works for me. Well, I can just put the first commit in a draft PR so the work done for updating the Rust stuff doesn't go to waste. I mean, the NDK stuff took me the most time. But still, could be nice to have something we can insta-merge to get back on track when Anki has another release.

voczi commented 1 month ago

There may have been some code duplication in the workflow... 👀 Fixed now.

user1823 commented 1 month ago

@mikehardy, if you have the time, would you please have a look at this? I have been waiting for a release with Anki 24.06.3 since long.

mikehardy commented 4 weeks ago

(actually there is one tiny problem with ./gradlew jacocoTestReport in Anki-Android but it looks suspiciously like a timestamp value and it looks suspiciously like exactly the sort of thing that would change as anki changes - that is, we were asserting some thing we thought was fixed but either behavior changed or the value did not mean what we thought it meant - either way, not this PRs fault I think...will pursue elsewhere

SchedulerTest > test_preview FAILED
    java.lang.AssertionError: expected:<1724180149594> but was:<1724180149595>
        at org.junit.Assert.fail(Assert.java:89)
        at org.junit.Assert.failNotEquals(Assert.java:835)
        at org.junit.Assert.assertEquals(Assert.java:647)
        at org.junit.Assert.assertEquals(Assert.java:633)
        at com.ichi2.libanki.SchedulerTest.test_preview(SchedulerTest.kt:881)

)