Skip to content

Commit 4a64d8e

Browse files
kirklandsignpytorchbot
authored andcommitted
Use fbjni 0.7.0 and set ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON (#14418)
Partial fix for #11597 We can upgrade to NDK 28 when fbjni upgrades. (cherry picked from commit 0f22062)
1 parent 5452e68 commit 4a64d8e

File tree

7 files changed

+8
-7
lines changed

7 files changed

+8
-7
lines changed

docs/source/using-executorch-android.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ To add the AAR file to your app:
8383
An AAR file itself does not contain dependency info, unlike the Maven one which bundled with pom.xml. The Java package requires `fbjni` and `soloader`, and currently requires users to explicitly declare the dependency. Therefore, two more `dependencies` in gradle rule is required:
8484
```
8585
implementation("com.facebook.soloader:soloader:0.10.5")
86-
implementation("com.facebook.fbjni:fbjni:0.5.1")
86+
implementation("com.facebook.fbjni:fbjni:0.7.0")
8787
```
8888

8989
### Example usage
@@ -100,7 +100,7 @@ And include it in gradle:
100100
dependencies {
101101
implementation(files("libs/executorch.aar"))
102102
implementation("com.facebook.soloader:soloader:0.10.5")
103-
implementation("com.facebook.fbjni:fbjni:0.5.1")
103+
implementation("com.facebook.fbjni:fbjni:0.7.0")
104104
}
105105
```
106106

examples/demo-apps/android/LlamaDemo/app/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ dependencies {
5757
implementation("androidx.appcompat:appcompat:1.6.1")
5858
implementation("androidx.camera:camera-core:1.3.0-rc02")
5959
implementation("androidx.constraintlayout:constraintlayout:2.2.0-alpha12")
60-
implementation("com.facebook.fbjni:fbjni:0.5.1")
60+
implementation("com.facebook.fbjni:fbjni:0.7.0")
6161
implementation("com.google.code.gson:gson:2.8.6")
6262
implementation(files("libs/executorch.aar"))
6363
implementation("com.google.android.material:material:1.12.0")

extension/android/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ endif()
3030
# libc++ dependencies are consistent. WARNING # Users need to use the SAME fbjni
3131
# version here and in app gradle dependency for runtime compatibility!
3232
if(NOT FBJNI_VERSION)
33-
set(FBJNI_VERSION 0.5.1)
33+
set(FBJNI_VERSION 0.7.0)
3434
endif()
3535

3636
set(FBJNI_AAR_URL

extension/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ allprojects {
66
compileSdkVersion = 34
77
buildToolsVersion = '33.0.1'
88

9-
fbjniJavaOnlyVersion = "0.5.1"
9+
fbjniJavaOnlyVersion = "0.7.0"
1010
soLoaderNativeLoaderVersion = "0.10.5"
1111
}
1212

extension/android/executorch_android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ task copyTestRes(type: Exec) {
4949
}
5050

5151
dependencies {
52-
implementation 'com.facebook.fbjni:fbjni:0.5.1'
52+
implementation 'com.facebook.fbjni:fbjni:0.7.0'
5353
implementation 'com.facebook.soloader:nativeloader:0.10.5'
5454
implementation libs.core.ktx
5555
testImplementation 'junit:junit:4.12'

extension/benchmark/android/benchmark/app/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ android {
4242
dependencies {
4343
implementation(files("libs/executorch.aar"))
4444
implementation("com.facebook.soloader:soloader:0.10.5")
45-
implementation("com.facebook.fbjni:fbjni:0.5.1")
45+
implementation("com.facebook.fbjni:fbjni:0.7.0")
4646
implementation("com.google.code.gson:gson:2.8.6")
4747
implementation("org.json:json:20250107")
4848
implementation("androidx.core:core-ktx:1.13.1")

scripts/build_android_library.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ build_android_native_library() {
3636

3737
cmake . -DCMAKE_INSTALL_PREFIX="${CMAKE_OUT}" \
3838
-DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK}/build/cmake/android.toolchain.cmake" \
39+
-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON \
3940
--preset "android-${ANDROID_ABI}" \
4041
-DANDROID_PLATFORM=android-26 \
4142
-DEXECUTORCH_ENABLE_EVENT_TRACER="${EXECUTORCH_ANDROID_PROFILING:-OFF}" \

0 commit comments

Comments
 (0)