tauri-apps / tauri

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

[bug] Tauri Android/Mac dev doesn't compile due to crate not found #10894

Closed eatenpancreas closed 2 months ago

eatenpancreas commented 2 months ago

Describe the bug

Hello, i'm trying to build a Tauri + svelte app on macOS and build for both IOS and Android, but i can't seem to get it to work. It does not build.

The stack traces claim i don't have X target installed. Down in additional context i have provided the list of targets, they're all installed and i have no idea why it's telling me this. I'm currently unable to build for both android and ios this way.

I've tried re-installing the targets, clearing the cargo cache, installing the newest version of java. No solutions so far. I hope there's an easy solution to this, thanks!

Reproduction

Expected behavior

The app on my emulator running, it does build when i don't specify android or ios and run it for mac itself

Full tauri info output

npm run tauri info

> tauri-app@0.1.0 tauri
> tauri info

[✔] Environment
    - OS: Mac OS 14.6.1 arm64 (X64)
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.80.1 (3f5fd8dd4 2024-08-06) (Homebrew)
    ✔ cargo: 1.80.1
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (default)
    - node: 22.7.0
    - pnpm: 8.15.3
    - npm: 10.8.2
    - bun: 1.0.1

[-] Packages
    - tauri 🦀: 2.0.0-rc.8
    - tauri-build 🦀: 2.0.0-rc.7
    - wry 🦀: 0.42.0
    - tao 🦀: 0.29.1
    - @tauri-apps/api : 2.0.0-rc.4
    - @tauri-apps/cli : 2.0.0-rc.10

[-] Plugins
    - tauri-plugin-shell 🦀: 2.0.0-rc.3
    - @tauri-apps/plugin-shell : 2.0.0-rc.1

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

[-] iOS
    - Developer Teams: None

Stack trace

ANDROID:
https://pastebin.com/PmWbFd3h

IOS:
https://pastebin.com/3FaYmJnu

Additional context

.zshrc:

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-22.jdk/Contents/Home
export ANDROID_HOME=$HOME/Library/Android/sdk
export NDK_HOME=$ANDROID_HOME/ndk/27.0.12077973
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin
export PATH=$NDK_HOME/toolchains/llvm/prebuilt/darwin-x86_64/bin:$PATH
> rustup target list
aarch64-apple-darwin (installed)
aarch64-apple-ios (installed)
aarch64-apple-ios-sim (installed)
aarch64-linux-android (installed)
aarch64-pc-windows-gnullvm
aarch64-pc-windows-msvc
aarch64-unknown-fuchsia
aarch64-unknown-linux-gnu
aarch64-unknown-linux-musl
aarch64-unknown-linux-ohos
aarch64-unknown-none
aarch64-unknown-none-softfloat
aarch64-unknown-uefi
arm-linux-androideabi
arm-unknown-linux-gnueabi
arm-unknown-linux-gnueabihf
arm-unknown-linux-musleabi
arm-unknown-linux-musleabihf
armebv7r-none-eabi
armebv7r-none-eabihf
armv5te-unknown-linux-gnueabi
armv5te-unknown-linux-musleabi
armv7-linux-androideabi (installed)
armv7-unknown-linux-gnueabi
armv7-unknown-linux-gnueabihf
armv7-unknown-linux-musleabi
armv7-unknown-linux-musleabihf
armv7-unknown-linux-ohos
armv7a-none-eabi
armv7r-none-eabi
armv7r-none-eabihf
i586-pc-windows-msvc
i586-unknown-linux-gnu
i586-unknown-linux-musl
i686-linux-android (installed)
i686-pc-windows-gnu
i686-pc-windows-gnullvm
i686-pc-windows-msvc
i686-unknown-freebsd
i686-unknown-linux-gnu
i686-unknown-linux-musl
i686-unknown-uefi
loongarch64-unknown-linux-gnu
loongarch64-unknown-none
loongarch64-unknown-none-softfloat
nvptx64-nvidia-cuda
powerpc-unknown-linux-gnu
powerpc64-unknown-linux-gnu
powerpc64le-unknown-linux-gnu
riscv32i-unknown-none-elf
riscv32im-unknown-none-elf
riscv32imac-unknown-none-elf
riscv32imafc-unknown-none-elf
riscv32imc-unknown-none-elf
riscv64gc-unknown-linux-gnu
riscv64gc-unknown-none-elf
riscv64imac-unknown-none-elf
s390x-unknown-linux-gnu
sparc64-unknown-linux-gnu
sparcv9-sun-solaris
thumbv6m-none-eabi
thumbv7em-none-eabi
thumbv7em-none-eabihf
thumbv7m-none-eabi
thumbv7neon-linux-androideabi
thumbv7neon-unknown-linux-gnueabihf
thumbv8m.base-none-eabi
thumbv8m.main-none-eabi
thumbv8m.main-none-eabihf
wasm32-unknown-emscripten
wasm32-unknown-unknown (installed)
wasm32-wasi
wasm32-wasip1
wasm32-wasip1-threads
x86_64-apple-darwin
x86_64-apple-ios (installed)
x86_64-fortanix-unknown-sgx
x86_64-linux-android (installed)
x86_64-pc-solaris
x86_64-pc-windows-gnu
x86_64-pc-windows-gnullvm
x86_64-pc-windows-msvc
x86_64-unknown-freebsd
x86_64-unknown-fuchsia
x86_64-unknown-illumos
x86_64-unknown-linux-gnu
x86_64-unknown-linux-gnux32
x86_64-unknown-linux-musl
x86_64-unknown-linux-ohos
x86_64-unknown-netbsd
x86_64-unknown-none
x86_64-unknown-redox
x86_64-unknown-uefi
FabianLars commented 2 months ago

The issue should be that you have 2 Rust installations, one via rustup (recommended) and one via homebrew. The targets installed via rustup are not recognized by the homebrew installation and vice versa. Either add the targets to the homebrew install (no idea how that works) or remove the homebrew rust install completely.

Feel free to re-open if it still does not work afterwards.

eatenpancreas commented 2 months ago

The issue should be that you have 2 Rust installations, one via rustup (recommended) and one via homebrew. The targets installed via rustup are not recognized by the homebrew installation and vice versa. Either add the targets to the homebrew install (no idea how that works) or remove the homebrew rust install completely.

Feel free to re-open if it still does not work afterwards.

Uninstalling the brew installation of rust worked. Thank you so much for the fast reply!