tauri-apps / tauri

Build smaller, faster, and more secure desktop and mobile applications with a web frontend.
https://tauri.app
Apache License 2.0
84.7k stars 2.55k forks source link

[bug] cargo tauri android dev -> cannot locate symbol __extenddftf2 #7413

Closed bburdette closed 3 months ago

bburdette commented 1 year ago

Describe the bug

The error:

07-12 08:17:11.613  5418  5418 E AndroidRuntime: FATAL EXCEPTION: main
07-12 08:17:11.613  5418  5418 E AndroidRuntime: Process: com.zknotes.zknotes_app, PID: 5418
07-12 08:17:11.613  5418  5418 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__extenddftf2" referenced by "/data/app/~~NzbfTP5fr--KRanTlXYCmQ==/com.zknotes.zknotes_app-LiJxE8nxNzlZ5FWeGRretw==/base.apk!/lib/x86_64/libapp_lib.so"...
`cargo tauri android dev` succeeds (with a lot of rust warnings, sorry): ``` [bburdette@HOSS:~/code/zknotes/zknotes/tauri/src-tauri]$ cargo tauri android dev Info Detected connected device: Pixel_3a_API_33_x86_64 (sdk_gphone64_x86_64) with target "x86_64-linux-android" Warn Waiting for your frontend dev server to start on http://10.0.0.85:8010/... Warn Waiting for your frontend dev server to start on http://10.0.0.85:8010/... Warn Waiting for your frontend dev server to start on http://10.0.0.85:8010/... Info detected host target triple "x86_64-unknown-linux-gnu" warning: skipping duplicate package `api` found at `/home/bburdette/.cargo/git/checkouts/tauri-9dcc2f9152472c1a/38d0bed/examples/web/core/api` warning: skipping duplicate package `app` found at `/home/bburdette/.cargo/git/checkouts/tauri-9dcc2f9152472c1a/38d0bed/tooling/cli/node/test/jest/fixtures/app/src-tauri` Compiling wry v0.28.3 Compiling tauri v2.0.0-alpha.10 (https://github.com/tauri-apps/tauri?rev=38d0bed8ebb6c5872fc54903051d146d386b721e#38d0bed8) warning: unused import: `warn` --> orgauth/rustlib/src/endpoints.rs:12:24 | 12 | use log::{error, info, warn}; | ^^^^ | = note: `#[warn(unused_imports)]` on by default warning: unused variable: `reg_key` --> orgauth/rustlib/src/endpoints.rs:118:20 | 118 | Some(ref reg_key) => { | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_reg_key` | = note: `#[warn(unused_variables)]` on by default warning: unused variable: `name` --> orgauth/rustlib/src/endpoints.rs:508:10 | 508 | let (name, token) = dbfun::change_email(&conn, uid, cp.clone())?; | ^^^^ help: if this is intentional, prefix it with an underscore: `_name` warning: unused variable: `token` --> orgauth/rustlib/src/endpoints.rs:508:16 | 508 | let (name, token) = dbfun::change_email(&conn, uid, cp.clone())?; | ^^^^^ help: if this is intentional, prefix it with an underscore: `_token` warning: unused `Result` that must be used --> orgauth/rustlib/src/endpoints.rs:53:5 | 53 | self.session.insert("token", uuid); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: this `Result` may be an `Err` variant, which should be handled = note: `#[warn(unused_must_use)]` on by default warning: `orgauth` (lib) generated 5 warnings (run `cargo fix --lib -p orgauth` to apply 4 suggestions) warning: unused import: `actix_web::HttpRequest` --> server-lib/src/interfaces.rs:5:5 | 5 | use actix_web::HttpRequest; | ^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default warning: unused import: `std::io::Read` --> server-lib/src/lib.rs:35:5 | 35 | use std::io::Read; | ^^^^^^^^^^^^^ warning: variable does not need to be mutable --> server-lib/src/lib.rs:72:7 | 72 | let mut staticpath = data.static_path.clone().unwrap_or(PathBuf::from("static/")); | ----^^^^^^^^^^ | | | help: remove this `mut` | = note: `#[warn(unused_mut)]` on by default warning: unused import: `Tokener` --> server-lib/src/lib.rs:27:51 | 27 | use orgauth::endpoints::{ActixTokener, Callbacks, Tokener}; | ^^^^^^^ warning: function `search_zknotes_simple` is never used --> server-lib/src/search.rs:243:8 | 243 | pub fn search_zknotes_simple( | ^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(dead_code)]` on by default warning: function `build_simple_sql` is never used --> server-lib/src/search.rs:321:8 | 321 | pub fn build_simple_sql( | ^^^^^^^^^^^^^^^^ warning: `zknotes-server-lib` (lib) generated 6 warnings (run `cargo fix --lib -p zknotes-server-lib` to apply 3 suggestions) Compiling zknotes-app v0.1.0 (/home/bburdette/code/zknotes/zknotes/tauri/src-tauri) Compiling tauri-runtime-wry v0.13.0-alpha.6 (https://github.com/tauri-apps/tauri?rev=38d0bed8ebb6c5872fc54903051d146d386b721e#38d0bed8) warning: unused import: `zknotes_server_lib::err_main` --> tauri/src-tauri/src/commands.rs:3:5 | 3 | use zknotes_server_lib::err_main; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default warning: unused imports: `Callbacks`, `Tokener` --> tauri/src-tauri/src/commands.rs:5:46 | 5 | use zknotes_server_lib::orgauth::endpoints::{Callbacks, Tokener, UuidTokener}; | ^^^^^^^^^ ^^^^^^^ warning: unused variable: `e` --> tauri/src-tauri/src/commands.rs:36:9 | 36 | Err(e) => ServerResponse { | ^ help: if this is intentional, prefix it with an underscore: `_e` | = note: `#[warn(unused_variables)]` on by default warning: unused variable: `e` --> tauri/src-tauri/src/commands.rs:56:9 | 56 | Err(e) => ServerResponse { | ^ help: if this is intentional, prefix it with an underscore: `_e` warning: unused variable: `e` --> tauri/src-tauri/src/commands.rs:78:9 | 78 | Err(e) => WhatMessage { | ^ help: if this is intentional, prefix it with an underscore: `_e` warning: `zknotes-app` (lib) generated 5 warnings (run `cargo fix --lib -p zknotes-app` to apply 5 suggestions) Finished dev [unoptimized + debuginfo] target(s) in 5.39s Info symlinking lib "/home/bburdette/code/zknotes/zknotes/target/x86_64-linux-android/debug/libapp_lib.so" in jniLibs dir "/home/bburdette/code/zknotes/zknotes/tauri/src-tauri/gen/android/app/src/main/jniLibs/x86_64" Info "/home/bburdette/code/zknotes/zknotes/target/x86_64-linux-android/debug/libapp_lib.so" requires shared lib "libandroid.so" Info "/home/bburdette/code/zknotes/zknotes/target/x86_64-linux-android/debug/libapp_lib.so" requires shared lib "libdl.so" Info "/home/bburdette/code/zknotes/zknotes/target/x86_64-linux-android/debug/libapp_lib.so" requires shared lib "liblog.so" Info "/home/bburdette/code/zknotes/zknotes/target/x86_64-linux-android/debug/libapp_lib.so" requires shared lib "libm.so" Info "/home/bburdette/code/zknotes/zknotes/target/x86_64-linux-android/debug/libapp_lib.so" requires shared lib "libc.so" Info symlink at "/home/bburdette/code/zknotes/zknotes/tauri/src-tauri/gen/android/app/src/main/jniLibs/x86_64/libapp_lib.so" points to "/home/bburdette/code/zknotes/zknotes/target/x86_64-linux-android/debug/libapp_lib.so" Info Accepting new connection 1/100 Error WS transport error: i/o error: Broken pipe (os error 32); terminate connection: 0 warning: skipping duplicate package `api` found at `/home/bburdette/.cargo/git/checkouts/tauri-9dcc2f9152472c1a/38d0bed/examples/web/core/api` warning: skipping duplicate package `app` found at `/home/bburdette/.cargo/git/checkouts/tauri-9dcc2f9152472c1a/38d0bed/tooling/cli/node/test/jest/fixtures/app/src-tauri` Compiling wry v0.28.3 Compiling tauri v2.0.0-alpha.10 (https://github.com/tauri-apps/tauri?rev=38d0bed8ebb6c5872fc54903051d146d386b721e#38d0bed8) warning: unused import: `warn` --> orgauth/rustlib/src/endpoints.rs:12:24 | 12 | use log::{error, info, warn}; | ^^^^ | = note: `#[warn(unused_imports)]` on by default warning: unused variable: `reg_key` --> orgauth/rustlib/src/endpoints.rs:118:20 | 118 | Some(ref reg_key) => { | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_reg_key` | = note: `#[warn(unused_variables)]` on by default warning: unused variable: `name` --> orgauth/rustlib/src/endpoints.rs:508:10 | 508 | let (name, token) = dbfun::change_email(&conn, uid, cp.clone())?; | ^^^^ help: if this is intentional, prefix it with an underscore: `_name` warning: unused variable: `token` --> orgauth/rustlib/src/endpoints.rs:508:16 | 508 | let (name, token) = dbfun::change_email(&conn, uid, cp.clone())?; | ^^^^^ help: if this is intentional, prefix it with an underscore: `_token` warning: unused `Result` that must be used --> orgauth/rustlib/src/endpoints.rs:53:5 | 53 | self.session.insert("token", uuid); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: this `Result` may be an `Err` variant, which should be handled = note: `#[warn(unused_must_use)]` on by default warning: `orgauth` (lib) generated 5 warnings (run `cargo fix --lib -p orgauth` to apply 4 suggestions) warning: unused import: `actix_web::HttpRequest` --> server-lib/src/interfaces.rs:5:5 | 5 | use actix_web::HttpRequest; | ^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default warning: unused import: `std::io::Read` --> server-lib/src/lib.rs:35:5 | 35 | use std::io::Read; | ^^^^^^^^^^^^^ warning: variable does not need to be mutable --> server-lib/src/lib.rs:72:7 | 72 | let mut staticpath = data.static_path.clone().unwrap_or(PathBuf::from("static/")); | ----^^^^^^^^^^ | | | help: remove this `mut` | = note: `#[warn(unused_mut)]` on by default warning: unused import: `Tokener` --> server-lib/src/lib.rs:27:51 | 27 | use orgauth::endpoints::{ActixTokener, Callbacks, Tokener}; | ^^^^^^^ warning: function `search_zknotes_simple` is never used --> server-lib/src/search.rs:243:8 | 243 | pub fn search_zknotes_simple( | ^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(dead_code)]` on by default warning: function `build_simple_sql` is never used --> server-lib/src/search.rs:321:8 | 321 | pub fn build_simple_sql( | ^^^^^^^^^^^^^^^^ warning: `zknotes-server-lib` (lib) generated 6 warnings (run `cargo fix --lib -p zknotes-server-lib` to apply 3 suggestions) Compiling zknotes-app v0.1.0 (/home/bburdette/code/zknotes/zknotes/tauri/src-tauri) Compiling tauri-runtime-wry v0.13.0-alpha.6 (https://github.com/tauri-apps/tauri?rev=38d0bed8ebb6c5872fc54903051d146d386b721e#38d0bed8) warning: unused import: `zknotes_server_lib::err_main` --> tauri/src-tauri/src/commands.rs:3:5 | 3 | use zknotes_server_lib::err_main; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default warning: unused imports: `Callbacks`, `Tokener` --> tauri/src-tauri/src/commands.rs:5:46 | 5 | use zknotes_server_lib::orgauth::endpoints::{Callbacks, Tokener, UuidTokener}; | ^^^^^^^^^ ^^^^^^^ warning: unused variable: `e` --> tauri/src-tauri/src/commands.rs:36:9 | 36 | Err(e) => ServerResponse { | ^ help: if this is intentional, prefix it with an underscore: `_e` | = note: `#[warn(unused_variables)]` on by default warning: unused variable: `e` --> tauri/src-tauri/src/commands.rs:56:9 | 56 | Err(e) => ServerResponse { | ^ help: if this is intentional, prefix it with an underscore: `_e` warning: unused variable: `e` --> tauri/src-tauri/src/commands.rs:78:9 | 78 | Err(e) => WhatMessage { | ^ help: if this is intentional, prefix it with an underscore: `_e` warning: `zknotes-app` (lib) generated 5 warnings (run `cargo fix --lib -p zknotes-app` to apply 5 suggestions) Finished dev [unoptimized + debuginfo] target(s) in 4.54s Info symlinking lib "/home/bburdette/code/zknotes/zknotes/target/x86_64-linux-android/debug/libapp_lib.so" in jniLibs dir "/home/bburdette/code/zknotes/zknotes/tauri/src-tauri/gen/android/app/src/main/jniLibs/x86_64" Info "/home/bburdette/code/zknotes/zknotes/target/x86_64-linux-android/debug/libapp_lib.so" requires shared lib "libandroid.so" Info "/home/bburdette/code/zknotes/zknotes/target/x86_64-linux-android/debug/libapp_lib.so" requires shared lib "libdl.so" Info "/home/bburdette/code/zknotes/zknotes/target/x86_64-linux-android/debug/libapp_lib.so" requires shared lib "liblog.so" Info "/home/bburdette/code/zknotes/zknotes/target/x86_64-linux-android/debug/libapp_lib.so" requires shared lib "libm.so" Info "/home/bburdette/code/zknotes/zknotes/target/x86_64-linux-android/debug/libapp_lib.so" requires shared lib "libc.so" Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. See https://docs.gradle.org/8.0/userguide/command_line_interface.html#sec:command_line_warnings Performing Streamed Install Success Starting: Intent { cmp=com.zknotes.zknotes_app/.MainActivity } ```

On the android VM, the app appears and immediately disappears again. But I don't get any crash messages.

Then, if I find the app in the android menu and start it, I get this ![image](https://github.com/tauri-apps/tauri/assets/157330/9f716ab1-8b78-4cc5-a272-02882885d7df) And in the console: ``` Info Watching /home/bburdette/code/zknotes/zknotes/zkprotocol for changes... Info Watching /home/bburdette/code/zknotes/zknotes/server for changes... Info Watching /home/bburdette/code/zknotes/zknotes/server-lib for changes... Info Watching /home/bburdette/code/zknotes/zknotes/orgauth/rustlib for changes... Info Watching /home/bburdette/code/zknotes/zknotes/tauri/src-tauri for changes... --------- beginning of main 07-12 08:17:11.247 5418 5418 I tes.zknotes_app: Late-enabling -Xcheck:jni 07-12 08:17:11.357 5418 5418 W tes.zknotes_app: Unexpected CPU variant for x86: x86_64. 07-12 08:17:11.357 5418 5418 W tes.zknotes_app: Known variants: atom, sandybridge, silvermont, kabylake, default 07-12 08:17:11.433 5418 5418 W ziparchive: Unable to open '/data/app/~~NzbfTP5fr--KRanTlXYCmQ==/com.zknotes.zknotes_app-LiJxE8nxNzlZ5FWeGRretw==/base.dm': No such file or directory 07-12 08:17:11.434 5418 5418 W ziparchive: Unable to open '/data/app/~~NzbfTP5fr--KRanTlXYCmQ==/com.zknotes.zknotes_app-LiJxE8nxNzlZ5FWeGRretw==/base.dm': No such file or directory --------- beginning of crash 07-12 08:17:11.613 5418 5418 E AndroidRuntime: FATAL EXCEPTION: main 07-12 08:17:11.613 5418 5418 E AndroidRuntime: Process: com.zknotes.zknotes_app, PID: 5418 07-12 08:17:11.613 5418 5418 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__extenddftf2" referenced by "/data/app/~~NzbfTP5fr--KRanTlXYCmQ==/com.zknotes.zknotes_app-LiJxE8nxNzlZ5FWeGRretw==/base.apk!/lib/x86_64/libapp_lib.so"... 07-12 08:17:11.613 5418 5418 E AndroidRuntime: at java.lang.Runtime.loadLibrary0(Runtime.java:1077) 07-12 08:17:11.613 5418 5418 E AndroidRuntime: at java.lang.Runtime.loadLibrary0(Runtime.java:998) 07-12 08:17:11.613 5418 5418 E AndroidRuntime: at java.lang.System.loadLibrary(System.java:1661) 07-12 08:17:11.613 5418 5418 E AndroidRuntime: at com.zknotes.zknotes_app.WryActivity.(WryActivity.kt:117) 07-12 08:17:11.613 5418 5418 E AndroidRuntime: at java.lang.Class.newInstance(Native Method) 07-12 08:17:11.613 5418 5418 E AndroidRuntime: at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95) 07-12 08:17:11.613 5418 5418 E AndroidRuntime: at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:45) 07-12 08:17:11.613 5418 5418 E AndroidRuntime: at android.app.Instrumentation.newActivity(Instrumentation.java:1339) 07-12 08:17:11.613 5418 5418 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3538) 07-12 08:17:11.613 5418 5418 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3782) 07-12 08:17:11.613 5418 5418 E AndroidRuntime: at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101) 07-12 08:17:11.613 5418 5418 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 07-12 08:17:11.613 5418 5418 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 07-12 08:17:11.613 5418 5418 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2307) 07-12 08:17:11.613 5418 5418 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106) 07-12 08:17:11.613 5418 5418 E AndroidRuntime: at android.os.Looper.loopOnce(Looper.java:201) 07-12 08:17:11.613 5418 5418 E AndroidRuntime: at android.os.Looper.loop(Looper.java:288) 07-12 08:17:11.613 5418 5418 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7872) 07-12 08:17:11.613 5418 5418 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 07-12 08:17:11.613 5418 5418 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) 07-12 08:17:11.613 5418 5418 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936) ```

my repo at the point where this error occurred.

Reproduction

Expected behavior

successful start, or at least no crash

Platform and versions

[⚠] Environment
    - OS: NixOS 23.5.0 X64
    ✔ webkit2gtk-4.1: 2.40.1
    ✔ rsvg2: 2.55.1
    ✔ rustc: 1.69.0 (84c898d65 2023-04-16)
    ✔ Cargo: 1.69.0 (6e9a83356 2023-04-12)
    ⚠ rustup: not installed!
      If you have rust installed some other way, we recommend uninstalling it
      then use rustup instead. Visit https://rustup.rs/
    ⚠ Rust toolchain: couldn't be detected!
      Maybe you don't have rustup installed? if so, Visit https://rustup.rs/
    - node: 18.16.0
    - npm: 9.5.1

[-] Packages
    - tauri [RUST]: git+https://github.com/tauri-apps/tauri?rev=tauri-v2.0.0-alpha.10#bd29b05f158c83b8a414a96ec66763a21a9530a2 (2.0.0-alpha.10)
    - tauri-build [RUST]: no manifest (2.0.0-alpha.6, 2.0.0-alpha.6)
    - wry [RUST]: 0.28.3
    - tao [RUST]: 0.19.1
    - @tauri-apps/api [NPM]: not installed!
    - @tauri-apps/cli [NPM]: 2.0.0-alpha.10

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: static
    - devPath: http://10.0.0.85:8010/

Stack trace

Starting: Intent { cmp=com.zknotes.zknotes_app/.MainActivity }
        Info Watching /home/bburdette/code/zknotes/zknotes/zkprotocol for changes...
        Info Watching /home/bburdette/code/zknotes/zknotes/server for changes...
        Info Watching /home/bburdette/code/zknotes/zknotes/server-lib for changes...
        Info Watching /home/bburdette/code/zknotes/zknotes/orgauth/rustlib for changes...
        Info Watching /home/bburdette/code/zknotes/zknotes/tauri/src-tauri for changes...
--------- beginning of main
07-12 08:44:38.473  7557  7557 I tes.zknotes_app: Late-enabling -Xcheck:jni
07-12 08:44:38.545  7557  7557 W tes.zknotes_app: Unexpected CPU variant for x86: x86_64.
07-12 08:44:38.545  7557  7557 W tes.zknotes_app: Known variants: atom, sandybridge, silvermont, kabylake, default
07-12 08:44:38.615  7557  7557 W ziparchive: Unable to open '/data/app/~~awJDtLjbebF83GeT8cCmdQ==/com.zknotes.zknotes_app-pHmZlxmTnYoEAaHWacszMg==/base.dm': No such file or directory
07-12 08:44:38.615  7557  7557 W ziparchive: Unable to open '/data/app/~~awJDtLjbebF83GeT8cCmdQ==/com.zknotes.zknotes_app-pHmZlxmTnYoEAaHWacszMg==/base.dm': No such file or directory
--------- beginning of crash
07-12 08:44:38.769  7557  7557 E AndroidRuntime: FATAL EXCEPTION: main
07-12 08:44:38.769  7557  7557 E AndroidRuntime: Process: com.zknotes.zknotes_app, PID: 7557
07-12 08:44:38.769  7557  7557 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__extenddftf2" referenced by "/data/app/~~awJDtLjbebF83GeT8cCmdQ==/com.zknotes.zknotes_app-pHmZlxmTnYoEAaHWacszMg==/base.apk!/lib/x86_64/libapp_lib.so"...
07-12 08:44:38.769  7557  7557 E AndroidRuntime:    at java.lang.Runtime.loadLibrary0(Runtime.java:1077)
07-12 08:44:38.769  7557  7557 E AndroidRuntime:    at java.lang.Runtime.loadLibrary0(Runtime.java:998)
07-12 08:44:38.769  7557  7557 E AndroidRuntime:    at java.lang.System.loadLibrary(System.java:1661)
07-12 08:44:38.769  7557  7557 E AndroidRuntime:    at com.zknotes.zknotes_app.WryActivity.<clinit>(WryActivity.kt:117)
07-12 08:44:38.769  7557  7557 E AndroidRuntime:    at java.lang.Class.newInstance(Native Method)
07-12 08:44:38.769  7557  7557 E AndroidRuntime:    at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95)
07-12 08:44:38.769  7557  7557 E AndroidRuntime:    at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:45)
07-12 08:44:38.769  7557  7557 E AndroidRuntime:    at android.app.Instrumentation.newActivity(Instrumentation.java:1339)
07-12 08:44:38.769  7557  7557 E AndroidRuntime:    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3538)
07-12 08:44:38.769  7557  7557 E AndroidRuntime:    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3782)
07-12 08:44:38.769  7557  7557 E AndroidRuntime:    at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
07-12 08:44:38.769  7557  7557 E AndroidRuntime:    at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
07-12 08:44:38.769  7557  7557 E AndroidRuntime:    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
07-12 08:44:38.769  7557  7557 E AndroidRuntime:    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2307)
07-12 08:44:38.769  7557  7557 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:106)
07-12 08:44:38.769  7557  7557 E AndroidRuntime:    at android.os.Looper.loopOnce(Looper.java:201)
07-12 08:44:38.769  7557  7557 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:288)
07-12 08:44:38.769  7557  7557 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:7872)
07-12 08:44:38.769  7557  7557 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
07-12 08:44:38.769  7557  7557 E AndroidRuntime:    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
07-12 08:44:38.769  7557  7557 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)


### Additional context

_No response_
meowtec commented 1 year ago

The same problem happened when I used crate sqlite in my app.

bburdette commented 1 year ago

The same problem happened when I used crate sqlite in my app.

yeah think I'll try removing the server code altogether and see if it works then.

bburdette commented 1 year ago

Ok I commented out the server dependent parts from the code, recompiled and it starts up without crashing. So that should rule out something weird in my setup that prevents any tauri android app from working.

End of the build log from this run (cargo tauri android dev):: ``` Finished dev [unoptimized + debuginfo] target(s) in 11.71s Info symlinking lib "/home/bburdette/code/zknotes/zknotes/target/x86_64-linux-android/debug/libapp_lib.so" in jniLibs dir "/home/bburdette/code/zknotes/zknotes/tauri/src-tauri/gen/android/app/src/main/jniLibs/x86_64" Info "/home/bburdette/code/zknotes/zknotes/target/x86_64-linux-android/debug/libapp_lib.so" requires shared lib "libandroid.so" Info "/home/bburdette/code/zknotes/zknotes/target/x86_64-linux-android/debug/libapp_lib.so" requires shared lib "libdl.so" Info "/home/bburdette/code/zknotes/zknotes/target/x86_64-linux-android/debug/libapp_lib.so" requires shared lib "liblog.so" Info "/home/bburdette/code/zknotes/zknotes/target/x86_64-linux-android/debug/libapp_lib.so" requires shared lib "libm.so" Info "/home/bburdette/code/zknotes/zknotes/target/x86_64-linux-android/debug/libapp_lib.so" requires shared lib "libc.so" Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. See https://docs.gradle.org/8.0/userguide/command_line_interface.html#sec:command_line_warnings Performing Streamed Install Success Starting: Intent { cmp=com.zknotes.zknotes_app/.MainActivity } Info Watching /home/bburdette/code/zknotes/zknotes/zkprotocol for changes... Info Watching /home/bburdette/code/zknotes/zknotes/server for changes... Info Watching /home/bburdette/code/zknotes/zknotes/server-lib for changes... Info Watching /home/bburdette/code/zknotes/zknotes/orgauth/rustlib for changes... Info Watching /home/bburdette/code/zknotes/zknotes/tauri/src-tauri for changes... --------- beginning of main 07-18 11:53:41.254 5608 5608 I tes.zknotes_app: Late-enabling -Xcheck:jni 07-18 11:53:41.662 5608 5608 W tes.zknotes_app: Unexpected CPU variant for x86: x86_64. 07-18 11:53:41.662 5608 5608 W tes.zknotes_app: Known variants: atom, sandybridge, silvermont, kabylake, default 07-18 11:53:41.927 5608 5608 W ziparchive: Unable to open '/data/app/~~xRxfOWoQxfQKoO_KWLIRPA==/com.zknotes.zknotes_app-ob5rCZDFN3Onz07ao0rRrg==/base.dm': No such file or directory 07-18 11:53:41.928 5608 5608 W ziparchive: Unable to open '/data/app/~~xRxfOWoQxfQKoO_KWLIRPA==/com.zknotes.zknotes_app-ob5rCZDFN3Onz07ao0rRrg==/base.dm': No such file or directory 07-18 11:53:42.513 5608 5608 W tes.zknotes_app: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (unsupported, reflection, allowed) 07-18 11:53:42.521 5608 5608 W tes.zknotes_app: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (unsupported, reflection, allowed) 07-18 11:53:42.649 5608 5608 I WebViewFactory: Loading com.google.android.webview version 103.0.5060.71 (code 506007137) 07-18 11:53:43.125 5608 5608 W tes.zknotes_app: Accessing hidden method Landroid/os/Trace;->isTagEnabled(J)Z (unsupported, reflection, allowed) 07-18 11:53:43.126 5608 5608 W tes.zknotes_app: Accessing hidden method Landroid/os/Trace;->traceBegin(JLjava/lang/String;)V (unsupported, reflection, allowed) 07-18 11:53:43.126 5608 5608 W tes.zknotes_app: Accessing hidden method Landroid/os/Trace;->traceEnd(J)V (unsupported, reflection, allowed) 07-18 11:53:43.126 5608 5608 W tes.zknotes_app: Accessing hidden method Landroid/os/Trace;->asyncTraceBegin(JLjava/lang/String;I)V (unsupported, reflection, allowed) 07-18 11:53:43.126 5608 5608 W tes.zknotes_app: Accessing hidden method Landroid/os/Trace;->asyncTraceEnd(JLjava/lang/String;I)V (unsupported, reflection, allowed) 07-18 11:53:43.137 5608 5608 I cr_WVCFactoryProvider: Loaded version=103.0.5060.71 minSdkVersion=29 isBundle=false multiprocess=true packageId=2 07-18 11:53:43.200 5608 5645 I cr_VariationsUtils: Failed reading seed file "/data/user/0/com.zknotes.zknotes_app/app_webview/variations_seed_new" 07-18 11:53:43.201 5608 5645 I cr_VariationsUtils: Failed reading seed file "/data/user/0/com.zknotes.zknotes_app/app_webview/variations_seed" 07-18 11:53:43.202 5608 5645 I cr_VariationsUtils: Requesting new seed from IVariationsSeedServer 07-18 11:53:43.240 5608 5608 I cr_LibraryLoader: Successfully loaded native library 07-18 11:53:43.247 5608 5608 I cr_CachingUmaRecorder: Flushed 9 samples from 9 histograms. 07-18 11:53:43.622 5608 5676 W chromium: [WARNING:dns_config_service_android.cc(115)] Failed to read DnsConfig. 07-18 11:53:43.622 5608 5639 I RustStdoutStderr: [WARNING:dns_config_service_android.cc(115)] Failed to read DnsConfig. 07-18 11:53:44.107 5608 5608 I Choreographer: Skipped 91 frames! The application may be doing too much work on its main thread. 07-18 11:53:44.276 5608 5635 W OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without... 07-18 11:53:44.276 5608 5635 W OpenGLRenderer: Failed to initialize 101010-2 format, error = EGL_SUCCESS 07-18 11:53:44.446 5608 5635 I Gralloc4: mapper 4.x is not supported 07-18 11:53:44.492 5608 5635 W Gralloc4: allocator 4.x is not supported 07-18 11:53:44.596 5608 5639 I RustStdoutStderr: s_glBindAttribLocation: bind attrib 0 name position 07-18 11:53:44.596 5608 5639 I RustStdoutStderr: s_glBindAttribLocation: bind attrib 1 name color 07-18 11:53:44.603 5608 5635 W Parcel : Expecting binder but got null! 07-18 11:53:44.616 5608 5626 I OpenGLRenderer: Davey! duration=2020ms; Flags=1, FrameTimelineVsyncId=9589, IntendedVsync=362597203906, Vsync=364113870512, InputEventId=0, HandleInputStart=364123778826, AnimationStart=364123780837, PerformTraversalsStart=364123781750, DrawStart=364521699605, FrameDeadline=362613870572, FrameInterval=364123706097, FrameStartTime=16666666, SyncQueued=364587590850, SyncStart=364588664049, IssueDrawCommandsStart=364589159796, SwapBuffers=364614817074, FrameCompleted=364618388730, DequeueBufferDuration=3989, QueueBufferDuration=283049, GpuCompleted=364618315642, SwapBuffersCompleted=364618388730, DisplayPresentTime=0, CommandSubmissionCompleted=364614817074, 07-18 11:53:44.668 5608 5682 W tes.zknotes_app: Accessing hidden method Landroid/media/AudioManager;->getOutputLatency(I)I (unsupported, reflection, allowed) 07-18 11:53:44.726 5608 5608 I Choreographer: Skipped 33 frames! The application may be doing too much work on its main thread. 07-18 11:53:44.885 5608 5682 W cr_media: Requires BLUETOOTH permission 07-18 11:53:44.917 5608 5626 I OpenGLRenderer: Davey! duration=727ms; Flags=0, FrameTimelineVsyncId=9904, IntendedVsync=364180537176, Vsync=364730537154, InputEventId=0, HandleInputStart=364743188673, AnimationStart=364743191582, PerformTraversalsStart=364745246951, DrawStart=364746283204, FrameDeadline=364647203824, FrameInterval=364743076273, FrameStartTime=16666666, SyncQueued=364748041779, SyncStart=364748943001, IssueDrawCommandsStart=364748988847, SwapBuffers=364898351442, FrameCompleted=364908721075, DequeueBufferDuration=4407, QueueBufferDuration=173491, GpuCompleted=364908721075, SwapBuffersCompleted=364900660382, DisplayPresentTime=137533442752512, CommandSubmissionCompleted=364898351442, 07-18 11:53:45.567 5608 5608 W Tauri/Console: File: https://tauri.localhost/main.js - Line 80 - Msg: Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets. 07-18 11:53:45.610 5608 5639 I RustStdoutStderr: greeet 07-18 11:53:45.643 5608 5608 I Tauri/Console: File: https://tauri.localhost/ - Line 422 - Msg: Hello, World! 07-18 11:53:45.649 5608 5608 I Tauri/Console: File: https://tauri.localhost/main.js - Line 244 - Msg: zzzz sendZIMsg tauri:: True 07-18 11:53:45.650 5608 5608 I Tauri/Console: File: https://tauri.localhost/main.js - Line 244 - Msg: zzzz sendZIMsgTauri: SearchZkNotes { limit = Just 50, list = False, offset = 0, tagSearch = [Boolex (SearchTerm [ExactMatch,Tag] "search") And (SearchTerm [User] "ben")], what = "prevSearches" } 07-18 11:53:45.650 5608 5608 I Tauri/Console: File: https://tauri.localhost/main.js - Line 244 - Msg: zzzz sendZIMsg tauri:: True 07-18 11:53:45.650 5608 5608 I Tauri/Console: File: https://tauri.localhost/main.js - Line 244 - Msg: zzzz sendZIMsgTauri: GetZkNoteEdit { what = "", zknote = 2623 } 07-18 11:53:45.650 5608 5608 I Tauri/Console: File: https://tauri.localhost/main.js - Line 244 - Msg: zzzz sendZIMsg tauri:: True 07-18 11:53:45.651 5608 5608 I Tauri/Console: File: https://tauri.localhost/main.js - Line 244 - Msg: zzzz sendZIMsgTauri: SearchZkNotes { limit = Just 50, list = False, offset = 0, tagSearch = [Boolex (SearchTerm [ExactMatch,Tag] "search") And (SearchTerm [User] "ben")], what = "prevSearches" } 07-18 11:53:45.654 5608 5608 I Tauri/Console: File: https://tauri.localhost/ - Line 392 - Msg: sendZIValueTauri [object Object] 07-18 11:53:45.655 5608 5608 I Tauri/Console: File: https://tauri.localhost/ - Line 392 - Msg: sendZIValueTauri [object Object] 07-18 11:53:45.656 5608 5608 I Tauri/Console: File: https://tauri.localhost/ - Line 392 - Msg: sendZIValueTauri [object Object] 07-18 11:53:45.686 5608 5608 E Tauri/Console: File: https://tauri.localhost/ - Line 0 - Msg: Uncaught (in promise) invalid args `msg` for command `zimsg`: invalid type: map, expected a string 07-18 11:53:45.687 5608 5608 E Tauri/Console: File: https://tauri.localhost/ - Line 0 - Msg: Uncaught (in promise) invalid args `msg` for command `zimsg`: invalid type: map, expected a string 07-18 11:53:45.687 5608 5608 E Tauri/Console: File: https://tauri.localhost/ - Line 0 - Msg: Uncaught (in promise) invalid args `msg` for command `zimsg`: invalid type: map, expected a string 07-18 11:53:45.728 5608 5639 I RustStdoutStderr: s_glBindAttribLocation: bind attrib 0 name inPosition 07-18 11:53:45.728 5608 5639 I RustStdoutStderr: s_glBindAttribLocation: bind attrib 1 name inColor 07-18 11:53:45.728 5608 5639 I RustStdoutStderr: s_glBindAttribLocation: bind attrib 2 name inTextureCoords 07-18 11:53:45.742 5608 5639 I RustStdoutStderr: s_glBindAttribLocation: bind attrib 0 name position 07-18 11:53:45.742 5608 5639 I RustStdoutStderr: s_glBindAttribLocation: bind attrib 1 name localCoord ```

For reference, this is the "Finished dev" bit from the build including my server (with sqlite statically linked and etc).

    Finished dev [unoptimized + debuginfo] target(s) in 4.54s
        Info symlinking lib "/home/bburdette/code/zknotes/zknotes/target/x86_64-linux-android/debug/libapp_lib.so" in jniLibs dir "/home/bburdette/code/zknotes/zknotes/tauri/src-tauri/gen/android/app/src/main/jniLibs/x86_64"
        Info "/home/bburdette/code/zknotes/zknotes/target/x86_64-linux-android/debug/libapp_lib.so" requires shared lib "libandroid.so"
        Info "/home/bburdette/code/zknotes/zknotes/target/x86_64-linux-android/debug/libapp_lib.so" requires shared lib "libdl.so"
        Info "/home/bburdette/code/zknotes/zknotes/target/x86_64-linux-android/debug/libapp_lib.so" requires shared lib "liblog.so"
        Info "/home/bburdette/code/zknotes/zknotes/target/x86_64-linux-android/debug/libapp_lib.so" requires shared lib "libm.so"
        Info "/home/bburdette/code/zknotes/zknotes/target/x86_64-linux-android/debug/libapp_lib.so" requires shared lib "libc.so"

And here is the same part without the server linked in. Identical list of libs. But perhaps there is another dependency that is not reported here.

    Finished dev [unoptimized + debuginfo] target(s) in 11.71s
        Info symlinking lib "/home/bburdette/code/zknotes/zknotes/target/x86_64-linux-android/debug/libapp_lib.so" in jniLibs dir "/home/bburdette/code/zknotes/zknotes/tauri/src-tauri/gen/android/app/src/main/jniLibs/x86_64"
        Info "/home/bburdette/code/zknotes/zknotes/target/x86_64-linux-android/debug/libapp_lib.so" requires shared lib "libandroid.so"
        Info "/home/bburdette/code/zknotes/zknotes/target/x86_64-linux-android/debug/libapp_lib.so" requires shared lib "libdl.so"
        Info "/home/bburdette/code/zknotes/zknotes/target/x86_64-linux-android/debug/libapp_lib.so" requires shared lib "liblog.so"
        Info "/home/bburdette/code/zknotes/zknotes/target/x86_64-linux-android/debug/libapp_lib.so" requires shared lib "libm.so"
        Info "/home/bburdette/code/zknotes/zknotes/target/x86_64-linux-android/debug/libapp_lib.so" requires shared lib "libc.so"
bburdette commented 1 year ago

Running with @meowtec 's idea, I put rusqlite in as a dependency (but 'bundled' so should statically link) and got the error again.

diff vs the version that doesn't crash. tldr added rusqlte and called a couple of its functions ``` bburdette@HOSS:~/code/zknotes/zknotes/tauri/src-tauri]$ git diff diff --git a/Cargo.lock b/Cargo.lock index ad4f898..3a94982 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4872,6 +4872,7 @@ name = "zknotes-app" version = "0.1.0" dependencies = [ "log", + "rusqlite", "serde", "serde_json", "tauri", diff --git a/tauri/src-tauri/Cargo.toml b/tauri/src-tauri/Cargo.toml index bf88a04..0856404 100644 --- a/tauri/src-tauri/Cargo.toml +++ b/tauri/src-tauri/Cargo.toml @@ -24,6 +24,7 @@ serde = { version = "1.0", features = ["derive"] } # tauri = { git = "https://github.com/tauri-apps/tauri", rev = "2d2fd6abe291ddf645fa2fdecc08111d2c0e258e", features = [] } # tauri = { git = "https://github.com/tauri-apps/tauri", rev = "38d0bed8ebb6c5872fc54903051d146d386b721e", features = [] } tauri = { git = "https://github.com/tauri-apps/tauri", rev = "tauri-v2.0.0-alpha.10", features = [] } +rusqlite = { version = "0.29.0", features = ["bundled"] } # zknotes deps # zknotes-server-lib = { path = "../../server-lib" } diff --git a/tauri/src-tauri/src/lib.rs b/tauri/src-tauri/src/lib.rs index 954f1f9..123e4df 100644 --- a/tauri/src-tauri/src/lib.rs +++ b/tauri/src-tauri/src/lib.rs @@ -1,5 +1,6 @@ mod commands; use commands::{greet, pimsg, uimsg, zimsg, ZkState}; +use rusqlite; #[cfg_attr(mobile, tauri::mobile_entry_point)] pub fn run() { @@ -11,4 +12,7 @@ pub fn run() { .invoke_handler(tauri::generate_handler![greet, zimsg, pimsg, uimsg]) .run(tauri::generate_context!()) .expect("error while running tauri application"); + + let conn = rusqlite::Connection::open("/dev/null").unwrap(); + println!("{}", conn.last_insert_rowid()); } ```
pretty much same crash with this minimal rusqlite dependency ``` See https://docs.gradle.org/8.0/userguide/command_line_interface.html#sec:command_line_warnings Performing Streamed Install Success Starting: Intent { cmp=com.zknotes.zknotes_app/.MainActivity } Info Watching /home/bburdette/code/zknotes/zknotes/zkprotocol for changes... Info Watching /home/bburdette/code/zknotes/zknotes/server for changes... Info Watching /home/bburdette/code/zknotes/zknotes/server-lib for changes... Info Watching /home/bburdette/code/zknotes/zknotes/orgauth/rustlib for changes... Info Watching /home/bburdette/code/zknotes/zknotes/tauri/src-tauri for changes... --------- beginning of main 07-20 20:42:45.335 7306 7306 I tes.zknotes_app: Late-enabling -Xcheck:jni 07-20 20:42:45.400 7306 7306 W tes.zknotes_app: Unexpected CPU variant for x86: x86_64. 07-20 20:42:45.400 7306 7306 W tes.zknotes_app: Known variants: atom, sandybridge, silvermont, kabylake, default 07-20 20:42:45.465 7306 7306 W ziparchive: Unable to open '/data/app/~~iBnLOrdfcmT-oPY3WQK3ZA==/com.zknotes.zknotes_app-o8oaqAPe6PcLllPf7t5lTg==/base.dm': No such file or directory 07-20 20:42:45.465 7306 7306 W ziparchive: Unable to open '/data/app/~~iBnLOrdfcmT-oPY3WQK3ZA==/com.zknotes.zknotes_app-o8oaqAPe6PcLllPf7t5lTg==/base.dm': No such file or directory --------- beginning of crash 07-20 20:42:45.602 7306 7306 E AndroidRuntime: FATAL EXCEPTION: main 07-20 20:42:45.602 7306 7306 E AndroidRuntime: Process: com.zknotes.zknotes_app, PID: 7306 07-20 20:42:45.602 7306 7306 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__extenddftf2" referenced by "/data/app/~~iBnLOrdfcmT-oPY3WQK3ZA==/com.zknotes.zknotes_app-o8oaqAPe6PcLllPf7t5lTg==/base.apk!/lib/x86_64/libapp_lib.so"... 07-20 20:42:45.602 7306 7306 E AndroidRuntime: at java.lang.Runtime.loadLibrary0(Runtime.java:1077) 07-20 20:42:45.602 7306 7306 E AndroidRuntime: at java.lang.Runtime.loadLibrary0(Runtime.java:998) 07-20 20:42:45.602 7306 7306 E AndroidRuntime: at java.lang.System.loadLibrary(System.java:1661) 07-20 20:42:45.602 7306 7306 E AndroidRuntime: at com.zknotes.zknotes_app.WryActivity.(WryActivity.kt:117) 07-20 20:42:45.602 7306 7306 E AndroidRuntime: at java.lang.Class.newInstance(Native Method) 07-20 20:42:45.602 7306 7306 E AndroidRuntime: at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95) 07-20 20:42:45.602 7306 7306 E AndroidRuntime: at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:45) 07-20 20:42:45.602 7306 7306 E AndroidRuntime: at android.app.Instrumentation.newActivity(Instrumentation.java:1339) 07-20 20:42:45.602 7306 7306 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3538) 07-20 20:42:45.602 7306 7306 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3782) 07-20 20:42:45.602 7306 7306 E AndroidRuntime: at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101) 07-20 20:42:45.602 7306 7306 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 07-20 20:42:45.602 7306 7306 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 07-20 20:42:45.602 7306 7306 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2307) 07-20 20:42:45.602 7306 7306 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106) 07-20 20:42:45.602 7306 7306 E AndroidRuntime: at android.os.Looper.loopOnce(Looper.java:201) 07-20 20:42:45.602 7306 7306 E AndroidRuntime: at android.os.Looper.loop(Looper.java:288) 07-20 20:42:45.602 7306 7306 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7872) 07-20 20:42:45.602 7306 7306 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 07-20 20:42:45.602 7306 7306 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) 07-20 20:42:45.602 7306 7306 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936) ```
bburdette commented 1 year ago

So in rusqlites libsqlite3-sys/build.rs there's an env variable, CARGO_CFG_TARGET_OS which can be set to "android". So that's promising. But doing a cargo clean and then a build like this:

CARGO_CFG_TARGET_OS=android cargo tauri android dev

Still has the same crash behavior.

bburdette commented 1 year ago

FWIW, a rusqlite maintainer on their discord says rusqlite is in firefox for android, and works there. And that CARGO_CFG_TARGET_OS should be set automatically by cargo.

bburdette commented 1 year ago

Digging in a bit more; $ nm libapp_lib.so reveals:

00000000006a5740 t exprSetHeight
0000000000669180 t exprStructSize
000000000069fdd0 t exprTableColumn
000000000069fcb0 t exprTableRegister
00000000006635e0 t exprToRegister
0000000000664f20 t exprVectorRegister
                 U __extenddftf2
000000000066ed70 t extendFJMatch
                 U fchmod
                 U fchown
                 U fcntl
00000000005fd5a0 t fcntlSizeHint
0000000000c5e7d0 t fe_0
0000000000c5ba30 t fe_1
0000000000c5bc40 t fe_add
0000000000c5bbc0 t fe_carry
0000000000c63ce0 t fe_cmov

And this symbol is part of libgcc.

So presumably there's a libgcc binary on android that contains this function? Does android need to be told somehow that libgcc is needed for libapp_lib.so?

bburdette commented 1 year ago

After doing a bit of reading today, I found out this problem supposedly occurs on x86-64, but not x86. Fired up an x86 android vm and voila, it runs and doesn't crash immediately like before. Hopefully the same will be true of arm targets.

This comment, when translated from the chinese, indicates success with clang compilation.

Its maybe possible an update in the android NDK would fix things, or reverting to an earlier version that still has libgcc in it would help.

There's this mozilla issue. They had a similar approach to our friend above, linking libclang_rt.builtins-x86_64-android for the x86-64 target.

bburdette commented 1 year ago

Coming back to this to report success with arm builds too, at least it works with my oneplus 6.

hanaTsuk1 commented 10 months ago

Waiting a solution for x86_64 ABI😫

hanaTsuk1 commented 10 months ago

It works for me https://github.com/breez/c-breez/issues/553#issuecomment-1731477289

lucasfernog commented 3 months ago

I'll close this one since it's not under our control, it's a rusqlite thing. See https://github.com/rusqlite/rusqlite/issues/1380 I've faced this issue before and the solution on this repo worked well: https://github.com/smartvaults/smartvaults/blob/be6fc3e1377a29942395c41fdd1ae7de86985286/bindings/smartvaults-sdk-ffi/build.rs#L16