Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] rusqlite crashes on Android emulator #8879

Closed
otamam818 opened this issue Feb 17, 2024 · 1 comment
Closed

[bug] rusqlite crashes on Android emulator #8879

otamam818 opened this issue Feb 17, 2024 · 1 comment
Labels
platform: Android status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@otamam818
Copy link

Describe the bug

Even when using derive to statically link the sqlite3 database, it causes the app to crash. I noticed that the app doesn't crash when simply adding the crate, but it crashes as soon as any call for rusqlite is made.

Reproduction

This issue has been replicated and described in detail in https://github.com/otamam818/issue_detector/tree/main/tauri-issues-app

The steps to reproduce it is:

  1. Use the latest version of create-tauri-app to initialize a beta version of the app (allowing mobile development)
  2. Open the created directory and install all dependencies
  3. Initialize the android project using npm run tauri android init or equivalent
  4. Add the rusqlite dependency with the derive feature flag enabled
  5. In any #[tauri::command] function, call any rusqlite code that interfaces with the file system (like rusqlite::Connection::open(database_path).unwrap();)

Expected behavior

The rusqlite code was supposed to open an existing database or create one if it didn't previously exist.

Full tauri info output

npm run tauri info

> [email protected] tauri
> tauri info


[✔] Environment
    - OS: Windows 10.0.19045 X64
    ✔ WebView2: 121.0.2277.112
    ✔ MSVC:
        - Visual Studio Build Tools 2019
        - Visual Studio Build Tools 2022
        - Visual Studio Community 2022
    ✔ rustc: 1.76.0 (07dca489a 2024-02-04)
    ✔ cargo: 1.76.0 (c84b36747 2024-01-18)
    ✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 20.11.0
    - yarn: 1.22.19
    - npm: 10.4.0

[-] Packages
    - tauri [RUST]: 2.0.0-beta.2
    - tauri-build [RUST]: 2.0.0-beta.1   
    - wry [RUST]: 0.35.2
    - tao [RUST]: 0.25.0
    - tauri-cli [RUST]: 1.5.3
    - @tauri-apps/api [NPM]: 2.0.0-beta.0
    - @tauri-apps/cli [NPM]: 2.0.0-beta.1

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/
    - framework: SolidJS
    - bundler: Vite

Stack trace

--------- beginning of main
02-17 11:59:37.989  3114  3114 I auri_issues_app: Late-enabling -Xcheck:jni
02-17 11:59:38.009  3114  3114 I auri_issues_app: Using CollectorTypeCC GC.
02-17 11:59:38.010  3114  3114 W auri_issues_app: Unexpected CPU variant for x86: x86_64.
02-17 11:59:38.010  3114  3114 W auri_issues_app: Known variants: atom, sandybridge, silvermont, goldmont, goldmont-plus, tremont, kabylake, default
02-17 11:59:38.085  3114  3114 W ziparchive: Unable to open '/data/app/~~oWhhee07OzLL55nrtCgF1A==/com.tauri.tauri_issues_app-6AshWwk-VAC3roCMDl_dDA==/base.dm': No such file or directory
02-17 11:59:38.085  3114  3114 W ziparchive: Unable to open '/data/app/~~oWhhee07OzLL55nrtCgF1A==/com.tauri.tauri_issues_app-6AshWwk-VAC3roCMDl_dDA==/base.dm': No such file or directory
--------- beginning of crash
02-17 11:59:38.324  3114  3114 E AndroidRuntime: FATAL EXCEPTION: main
02-17 11:59:38.324  3114  3114 E AndroidRuntime: Process: com.tauri.tauri_issues_app, PID: 3114
02-17 11:59:38.324  3114  3114 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__extenddftf2" referenced by "/data/app/~~oWhhee07OzLL55nrtCgF1A==/com.tauri.tauri_issues_app-6AshWwk-VAC3roCMDl_dDA==/base.apk!/lib/x86_64/libtauri_issues_app_lib.so"...
02-17 11:59:38.324  3114  3114 E AndroidRuntime:        at java.lang.Runtime.loadLibrary0(Runtime.java:1082)
02-17 11:59:38.324  3114  3114 E AndroidRuntime:        at java.lang.Runtime.loadLibrary0(Runtime.java:1003)
02-17 11:59:38.324  3114  3114 E AndroidRuntime:        at java.lang.System.loadLibrary(System.java:1661)
02-17 11:59:38.324  3114  3114 E AndroidRuntime:        at com.tauri.tauri_issues_app.WryActivity.<clinit>(WryActivity.kt:116)
02-17 11:59:38.324  3114  3114 E AndroidRuntime:        at java.lang.Class.newInstance(Native Method)
02-17 11:59:38.324  3114  3114 E AndroidRuntime:        at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95)
02-17 11:59:38.324  3114  3114 E AndroidRuntime:        at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:45)
02-17 11:59:38.324  3114  3114 E AndroidRuntime:        at android.app.Instrumentation.newActivity(Instrumentation.java:1378)
02-17 11:59:38.324  3114  3114 E AndroidRuntime:        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3676)
02-17 11:59:38.324  3114  3114 E AndroidRuntime:        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3922)
02-17 11:59:38.324  3114  3114 E AndroidRuntime:        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)
02-17 11:59:38.324  3114  3114 E AndroidRuntime:        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:139)
02-17 11:59:38.324  3114  3114 E AndroidRuntime:        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96)
02-17 11:59:38.324  3114  3114 E AndroidRuntime:        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2443)
02-17 11:59:38.324  3114  3114 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:106)
02-17 11:59:38.324  3114  3114 E AndroidRuntime:        at android.os.Looper.loopOnce(Looper.java:205)
02-17 11:59:38.324  3114  3114 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:294)
02-17 11:59:38.324  3114  3114 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:8177)
02-17 11:59:38.324  3114  3114 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
02-17 11:59:38.324  3114  3114 E AndroidRuntime:        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
02-17 11:59:38.324  3114  3114 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)

Additional context

It might be because rusqlite is made to handle files in the desktop only, but shouldn't there be a way to compile rusqlite to mobile devices too, or would that require changing how the source code works?

Thanks again for your time and all your hard work!

@otamam818 otamam818 added status: needs triage This issue needs to triage, applied to new issues type: bug labels Feb 17, 2024
@lucasfernog
Copy link
Member

duplicate of #7413

@lucasfernog lucasfernog closed this as not planned Won't fix, can't repro, duplicate, stale Aug 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: Android status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

3 participants