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.38k stars 2.58k forks source link

[bug] When using the cargo build command to build the Android APK, the error "failed to select a version for `piet-common`". #11700

Closed Mik-pan closed 6 days ago

Mik-pan commented 6 days ago

Describe the bug

image

Reproduction

No response

Expected behavior

This is the steps I tried to build:

Step 1: yarn tauri icon /path/to/app-icon.png (success) Step 2: yarn tauri android init (success, and generated files like src-tauri/gen/android/...) Step 3: yarn tauri android build --apk (shows "failed to select a version for piet-common) Step 4: yarn tauri android build --aab --target aarch64 --target armv7 (tried changing architectures, still shows "failed to select a version for piet-common")

Below are the necessary SDK and NDK that I have installed and configured environment variables for. What steps might I have missed?

image

Full tauri info output

Running beforeBuildCommand `yarn build`
vite v5.4.11 building for production...
transforming (1) index.htmlDeprecation Warning: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.

More info: https://sass-lang.com/d/legacy-js-api

transforming (10) src/Main.vueDeprecation Warning: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.

More info: https://sass-lang.com/d/legacy-js-api

✓ 33 modules transformed.
dist/index.html                  0.89 kB │ gzip:  0.52 kB
dist/assets/index-BrUCm4zZ.css   1.42 kB │ gzip:  0.66 kB
dist/assets/index-i9p039i8.js   84.99 kB │ gzip: 33.74 kB
✓ built in 535ms
error: failed to select a version for `piet-common`.
    ... required by package `first-tauri-project v0.1.0 (/Users/mik/project/tauri/first-tauri-project/src-tauri)`
versions that meet the requirements `^0.3.2` (locked to 0.3.2) are: 0.3.2

the package `first-tauri-project` depends on `piet-common`, with features: `skia` but `piet-common` does not have these features.

failed to select a version for `piet-common` which could resolve this conflict
`Failed to run `cargo build`: command ["cargo", "build", "--package", "first-tauri-project", "--manifest-path", "/Users/mik/project/tauri/first-tauri-project/src-tauri/Cargo.toml", "--target", "aarch64-linux-android", "--features", "tauri/custom-protocol tauri/rustls-tls", "--lib", "--release"] exited with code 101
    Error `Failed to run `cargo build`: command ["cargo", "build", "--package", "first-tauri-project", "--manifest-path", "/Users/mik/project/tauri/first-tauri-project/src-tauri/Cargo.toml", "--target", "aarch64-linux-android", "--features", "tauri/custom-protocol tauri/rustls-tls", "--lib", "--release"] exited with code 101

Stack trace

No response

Additional context

No response

FabianLars commented 5 days ago

can you delete the ~/.cargo/registry/ and src-tauri/target/ folders and try again? Maybe also run cargo update in the src-tauri dir afterwards.