Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

feat: support 32-bit android devices (#4940)

Lucas.Xu822d62b56289
diff --git a/frontend/appflowy_flutter/android/app/src/main/CMakeLists.txt b/frontend/appflowy_flutter/android/app/src/main/CMakeLists.txt
index 38b0aa5ca7..455c5081b6 100644
--- a/frontend/appflowy_flutter/android/app/src/main/CMakeLists.txt
+++ b/frontend/appflowy_flutter/android/app/src/main/CMakeLists.txt
@@ -11,6 +11,12 @@ file(COPY
DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/jniLibs/arm64-v8a
)
+# armeabi-v7a
+file(COPY
+ ${ANDROID_NDK}/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libc++_shared.so
+ DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/jniLibs/armeabi-v7a
+)
+
# x86_64
file(COPY
${ANDROID_NDK}/sources/cxx-stl/llvm-libc++/libs/x86_64/libc++_shared.so
diff --git a/frontend/appflowy_flutter/pubspec.lock b/frontend/appflowy_flutter/pubspec.lock
index cdd4ebc8ab..af24f4f87a 100644
--- a/frontend/appflowy_flutter/pubspec.lock
+++ b/frontend/appflowy_flutter/pubspec.lock
@@ -53,8 +53,8 @@ packages:
dependency: "direct main"
description:
path: "."
- ref: "2493d9b"
- resolved-ref: "2493d9b92009b41134a55863c3c8fb2c94b5df95"
+ ref: a571f2b
+ resolved-ref: a571f2bc9df764d90569951f40364c8c59787f30
url: "https://github.com/AppFlowy-IO/appflowy-editor.git"
source: git
version: "2.3.3"
diff --git a/frontend/appflowy_flutter/pubspec.yaml b/frontend/appflowy_flutter/pubspec.yaml
index 678909aead..13994a0b7f 100644
--- a/frontend/appflowy_flutter/pubspec.yaml
+++ b/frontend/appflowy_flutter/pubspec.yaml
@@ -167,7 +167,7 @@ dependency_overrides:
appflowy_editor:
git:
url: https://github.com/AppFlowy-IO/appflowy-editor.git
- ref: "2493d9b"
+ ref: "a571f2b"
sheet:
git:
diff --git a/frontend/rust-lib/Cargo.lock b/frontend/rust-lib/Cargo.lock
index c516725f37..78ad9c5c02 100644
--- a/frontend/rust-lib/Cargo.lock
+++ b/frontend/rust-lib/Cargo.lock
@@ -3007,8 +3007,7 @@ checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4"
[[package]]
name = "librocksdb-sys"
version = "0.11.0+8.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d3386f101bcb4bd252d8e9d2fb41ec3b0862a15a62b478c355b2982efa469e3e"
+source = "git+https://github.com/LucasXu0/rust-rocksdb?rev=21cf4a23ec131b9d82dc94e178fe8efc0c147b09#21cf4a23ec131b9d82dc94e178fe8efc0c147b09"
dependencies = [
"bindgen",
"bzip2-sys",
@@ -4548,8 +4547,7 @@ dependencies = [
[[package]]
name = "rocksdb"
version = "0.21.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bb6f170a4041d50a0ce04b0d2e14916d6ca863ea2e422689a5b694395d299ffe"
+source = "git+https://github.com/LucasXu0/rust-rocksdb?rev=21cf4a23ec131b9d82dc94e178fe8efc0c147b09#21cf4a23ec131b9d82dc94e178fe8efc0c147b09"
dependencies = [
"libc",
"librocksdb-sys",
diff --git a/frontend/rust-lib/Cargo.toml b/frontend/rust-lib/Cargo.toml
index 385c0f26fd..ec6a16b72f 100644
--- a/frontend/rust-lib/Cargo.toml
+++ b/frontend/rust-lib/Cargo.toml
@@ -100,6 +100,11 @@ lto = false
incremental = false
[patch.crates-io]
+
+# TODO(Lucas.Xu) Upgrade to the latest version of RocksDB once PR(https://github.com/rust-rocksdb/rust-rocksdb/pull/869) is merged.
+# Currently, using the following revision id. This commit is patched to fix the 32-bit build issue and it's checked out from 0.21.0, not 0.22.0.
+rocksdb = { git = "https://github.com/LucasXu0/rust-rocksdb", rev = "21cf4a23ec131b9d82dc94e178fe8efc0c147b09" }
+
# Please using the following command to update the revision id
# Current directory: frontend
# Run the script:
diff --git a/frontend/scripts/makefile/mobile.toml b/frontend/scripts/makefile/mobile.toml
index 41d6888281..8e89e4c2ed 100644
--- a/frontend/scripts/makefile/mobile.toml
+++ b/frontend/scripts/makefile/mobile.toml
@@ -68,10 +68,10 @@ script = [
cd rust-lib/
if [ "${BUILD_FLAG}" = "debug" ]; then
echo "πŸš€ πŸš€ πŸš€ Building Android SDK for debug"
- cargo ndk -t arm64-v8a -o ./jniLibs build --features "${FLUTTER_DESKTOP_FEATURES}" --package=dart-ffi
+ cargo ndk -t arm64-v8a -t armeabi-v7a -o ./jniLibs build --features "${FLUTTER_DESKTOP_FEATURES}" --package=dart-ffi
else
echo "πŸš€ πŸš€ πŸš€ Building Android SDK for release"
- cargo ndk -t arm64-v8a -o ./jniLibs build --features "${FLUTTER_DESKTOP_FEATURES}" --package=dart-ffi --release
+ cargo ndk -t arm64-v8a -t armeabi-v7a -o ./jniLibs build --features "${FLUTTER_DESKTOP_FEATURES}" --package=dart-ffi --release
fi
cd ../
""",
@@ -85,7 +85,7 @@ private = true
script = [
"""
cd rust-lib/
- cargo ndk -t arm64-v8a -o ./jniLibs build --features "${FLUTTER_DESKTOP_FEATURES}" --package=dart-ffi
+ cargo ndk -t arm64-v8a -t armeabi-v7a -o ./jniLibs build --features "${FLUTTER_DESKTOP_FEATURES}" --package=dart-ffi
cd ../
""",
]