Skip to content

[DJL Android] Enable Android 16 KB page size support #3815

@tiagoasilva

Description

@tiagoasilva

Description

Add linker flags to support 16KB page size on Android.

In Android Studio, in the build.gradle file, using
implementation("ai.djl.android:tokenizer-native:0.33.0")

The native library arm64-v8a/libdjl_tokenizer.so (from ai.djl.android:tokenizer-native:0.33.0) is not 16 KB aligned

See https://source.android.com/docs/core/architecture/16kb-page-size/16kb#build-lib-16kb-alignment and https://developer.android.com/guide/practices/page-sizes

Expected Behavior

The library arm64-v8a/libdjl_tokenizer.so should be 16 KB page size compliant

Error Message

The native library arm64-v8a/libdjl_tokenizer.so (from ai.djl.android:tokenizer-native:0.33.0) is not 16 KB aligned

How to Reproduce?

Import lib "ai.djl.android:tokenizer-native:0.33.0"
Sync Gradle
Build Android App
Check AS warning listing the lib as not compatible

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions