tauri-apps / tauri

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

[bug] tauri 2.0beta package android problem #8893

Open syf2012 opened 7 months ago

syf2012 commented 7 months ago

Describe the bug

use create-tauri-app create a project,After packaging the Android APK for tauri 2.0 beta, the package was large (45M)

Reproduction

No response

Expected behavior

No response

Full tauri info output

[✔] Environment
    - OS: Mac OS 13.5.2 X64
    ✔ Xcode Command Line Tools: installed
    ✔ 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-apple-darwin (default)
    - node: 18.10.0
    - yarn: 1.22.11
    - npm: 8.19.2

[-] 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
    - cargo-tauri [RUST]: 1.0.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: Vue.js
    - bundler: Vite

Stack trace

No response

Additional context

No response

canxin121 commented 7 months ago

I tried using Next.js as the front end and found that it only has a few MB, while react has more than 40 MB.

syirilrakhulh commented 7 months ago

In SolidJS I try to build an APK, and the size is 37MB (I don't add page or anything, just generate project and build). Can we reduce the size to smaller? Because previously I use Ionic and the size smaller, I have plan to migrate to Tauri. Or maybe someone can explain to me the reason size is bigger?

FabianLars commented 7 months ago

We didn't look into package size yet. 2.0 alpha was all about making it work, not optimizing it. bundle size is something we yet have to look into :)

WindRush commented 4 months ago

my packaged apk is 422M, i just init android, and tauri build it. have it solved yet?

FabianLars commented 4 months ago

422mb sounds like a debug build? try a release build instead, it should be 30 - 50mb. But no, we still didn't work on this and it probably won't make it part of the initial 2.0 release either. We're focused on making it work well and stable before optimizing it.