#Is there a way to get dev mode for android to work? (error: could not compile `tauri` (lib))

8 messages · Page 1 of 1 (latest)

sick jay
#

I'm trying to build an android app from the svelte starter project, but when trying dev mode, it results in an error. Here's what I did:

> pnpm create tauri --alpha --mobile
✔ Project name · tauri-app
✔ Choose which language to use for your frontend · TypeScript / JavaScript - (pnpm, yarn, npm, bun)
✔ Choose your package manager · pnpm
✔ Choose your UI template · Svelte - (https://svelte.dev/)
✔ Choose your UI flavor · TypeScript

Template created! To get started run:
  cd tauri-app
  pnpm install
  pnpm tauri android init

For Desktop development, run:
  pnpm tauri dev

For Android development, run:
  pnpm tauri android dev

> cd tauri-app
> pnpm i
Packages: +123
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 154, reused 123, downloaded 0, added 123, done

dependencies:
+ @tauri-apps/api 2.0.0-alpha.11
+ @tauri-apps/plugin-shell 2.0.0-alpha.3

devDependencies:
+ @sveltejs/vite-plugin-svelte 2.5.2 (3.0.0 is available)
+ @tauri-apps/cli 2.0.0-alpha.17
+ @tsconfig/svelte 5.0.2
+ internal-ip 7.0.0 (8.0.0 is available)
+ svelte 4.2.5
+ svelte-check 3.6.0
+ tslib 2.6.2
+ typescript 5.2.2
+ vite 4.5.0 (5.0.0 is available)

Done in 6.2s

> pnpm tauri android init

> tauri-app@0.0.0 tauri C:\Users\zsong\Documents\coding-projects\Personal\tauri-app
> tauri "android" "init"

Generating Android Studio project...
        Info "C:\\Users\\zsong\\Documents\\coding-projects\\Personal\\tauri-app\\src-tauri" relative to "C:\\Users\\zsong\\Documents\\coding-projects\\Personal\\tauri-app\\src-tauri\\gen/android\\tauri_app" is "..\\..\\..\\"
victory: Project generated successfully!
    Make cool apps! 🌻 🐕 🎉

That's the setup done, no errors.
Tried pnpm tauri dev, it runs fine, the example project opens up in a window. Even building for anything except android outputs a working program.

After this, I connected my phone with adb turned on and tried running android dev mode. Here's where the problems arose.
During some of the times I tried to do this, a seemingly random library failed to build with (exit code: 0xc0000005, STATUS_ACCESS_VIOLATION). But sometimes when it succeeds after trying again and starts to build the apk, it just ends up on another error, that says error: could not compile 'tauri' (lib), also with the same STATUS_ACCESS_VIOLATION code. I've uploaded the logs.
Unfortunately, I couldn't find anyone that had this problem on the github issues page, so I needed to come ask for help here. So I'd appreciate some.

#

Also I wanted to say that I'm quite new to android and rust development, but tried to follow the guides that are available as much as possible. So sorry if I missed anything.

sick jay
#

Is there a way to get dev mode for android to work? (error: could not compile tauri (lib))

#

I managed to get building the apk to work, so I changed the post title. Dev mode is still problematic

#

Trying to install the apk, this is the message I got:

open furnace
#

could you also post the output of pnpm tauri info please?
The only thing i found on rust's github was fixed after upgrading rust so maybe that can help here, access vialation is a weird one 🤔

sick jay
#

sure, here you go

[✔] Environment
    - OS: Windows 10.0.22621 X64
    ✔ WebView2: 119.0.2151.72
    ✔ MSVC:
        - Visual Studio Build Tools 2019
        - Visual Studio Community 2022
    ✔ rustc: 1.74.0 (79e9716c9 2023-11-13)
    ✔ cargo: 1.74.0 (ecb9851af 2023-10-18)
    ✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 20.8.0
    - pnpm: 8.10.5
    - npm: 10.1.0

[-] Packages
    - tauri [RUST]: 2.0.0-alpha.17
    - tauri-build [RUST]: 2.0.0-alpha.11
    - wry [RUST]: 0.34.2
    - tao [RUST]: 0.23.0
    - @tauri-apps/api [NPM]: 2.0.0-alpha.11
    - @tauri-apps/cli [NPM]: 2.0.0-alpha.17

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../dist
    - devPath: http://localhost:1420/
    - framework: Svelte
    - bundler: Vite