Open xavierserrai opened 4 months ago
Hello
I have the same demand.
I use the plugin in my major apps: cordova-sqlite-ext
I also use the following plugin on other app: cordova-sqlite-legacy-build-support
Hello, for info I did a small analysis of the concerned libraries.
Plugin cordova-sqlite-legacy-build-support 1.3.5 Library in analysed APK: lib/arm64-v8a/libsqlc-native-driver.so Dependencies in plugin.xml:
<source-file src="src/android/libs/sqlite-connector.jar" target-dir="libs"/>
<!-- Android-sqlite-connector native driver [native libs]: -->
<source-file src="src/android/libs/arm64-v8a/libsqlc-native-driver.so" target-dir="libs/arm64-v8a"/>
<source-file src="src/android/libs/armeabi/libsqlc-native-driver.so" target-dir="libs/armeabi"/>
<source-file src="src/android/libs/armeabi-v7a/libsqlc-native-driver.so" target-dir="libs/armeabi-v7a"/>
<source-file src="src/android/libs/x86/libsqlc-native-driver.so" target-dir="libs/x86"/>
<source-file src="src/android/libs/x86_64/libsqlc-native-driver.so" target-dir="libs/x86_64"/>
Plugin cordova-sqlite-ext 6.0.0 Library in analysed APK: lib/arm64-v8a/libsqlc-ndk-native.driver.so Dependencies in package.json: "dependencies": { "cordova-sqlite-ext-deps": "4.0.0" }
In Plugin cordova-sqlite-ext-deps
libs/
sqlite-native-ndk-connector.jar
sqlite-ndk-native-driver.jar
Documentation:
sqlite3.h, sqlite3.c - SQLite 3.32.3 amalgamation needed to build iOS/macOS and Windows platform versions
libb64-core, sqlite3-base64, and sqlite3-regexp-cached source for iOS/macOS/Windows platform versions
libs - JAR libraries built from brodybits/android-sqlite-ndk-native-driver and brodybits/android-sqlite-native-ndk-connector, built with SQLite 3.32.3 amalgamation
Any updates on this?
@brodycj
Hello
Here some infos/hints to help to correct the problem.
I found this depot who seems to generate the .so libs https://github.com/brodycj/Android-sqlite-ext-native-driver/blob/master/jni/Android.mk
Some doc: https://developer.android.com/guide/practices/page-sizes "If your app uses any native code, then you should rebuild your app with support for 16 KB devices."
With NDK 26 at minimum, it seems one of the following flags must be added: ndk-build: LOCAL_LDFLAGS += "-Wl,-z,max-page-size=16384" CMake: target_link_options(${CMAKE_PROJECT_NAME} PRIVATE "-Wl,-z,max-page-size=16384")
Additional infos, i recompiled the Libs (thanks to Norman B.).
Libs are not tested currently.
"I followed your exemple, i did not "make init", but i executed ndk-build. Libs are created, 4 systems just armeabi is missing, i analysed the ELF files, there are some differences with your build (I used NDK 26.1) but i see 0x4000 :clin_d'œil: I will do some tests with the New Libs.
Hello, tested with Pixel 8 With Android 15 QR1 + Page Size 16Kb Mode.
App don't works and are not downloadable from Google Play also.
Logs from google play store: did a adb log, and seems related... 08-24 19:59:25.598 3358 3358 E Finsky : [2] tpg.d(22): Submitter: commit error message INSTALL_FAILED_INVALID_APK: INSTALL_FAILED_INVALID_APK: Failed to extract native libraries, res=-2
20 h 02 08-24 19:59:25.584 1350 1692 E NativeLibraryHelper: Library 'libsqlc-ndk-native-driver.so' is not PAGE(16384)-aligned - will not be able to open it directly from apk.
I cloned https://github.com/brodycj/android-sqlite-ndk-native-driver and made changes to Application.mk as specified in Android documentation: https://developer.android.com/guide/practices/page-sizes#compile-r27-higher Used ndk 27 and build the repository and using "make", Executed "make Makefile" which generated the jar file from the .so files. Replaced the jar that this plugin uses from cordova-sqlite-storage-dependencies and built the app. App launches in Android 15 Emulator. Verified sqlite db functionality and it works.
Raised a PR on https://github.com/brodycj/android-sqlite-ndk-native-driver/pull/10 Waiting for the author @brodycj to re-build the project.
Thanks for your commit.
I advice you also test on real AAB Bu dle on Google Play. Because i had the following problem, recompilation seems not enough.
If not works, you will need to do that on your Main app.
In your Cordova app, you must add the following code in /app/build.gradle, under android { block: packagingOptions { jniLibs { useLegacyPackaging = true } }
@hooliapps, Thanks for the suggestion. You're correct, I couldn't install the app from play store (Bundle AAB). Adding the line provided in app/build.gradle fixed the installation. This means AGP version also needs to be updated to 8.5 or above as mentioned in Android documentation? https://developer.android.com/guide/practices/page-sizes#update-packaging
@brodycj , Any update?
Dears,
Beginning with Android 15, Android supports devices that are configured to use a page size of 16 KB (16 KB devices).
https://developer.android.com/guide/practices/page-sizes#other-build-systems
I have tested this plugin with an Android 15 emulator that uses 16KB page sizes and when creating a database app crashes giving the following error:
libsqlc-ndk-native-driver.so might need to be recompiled to support 16KB page sizes.
Thanks,