Skip to content

fix(cli): improve Android BuildTask.kt Windows executable detection for nvm4w Fixes #13892#14146

Merged
lucasfernog merged 3 commits intotauri-apps:devfrom
DomanskiFilip:fix-android-nvm4w-windows
Oct 7, 2025
Merged

fix(cli): improve Android BuildTask.kt Windows executable detection for nvm4w Fixes #13892#14146
lucasfernog merged 3 commits intotauri-apps:devfrom
DomanskiFilip:fix-android-nvm4w-windows

Conversation

@DomanskiFilip
Copy link
Contributor

Description

Fixes Android build error on Windows when using nvm4w Node.js installations.

Problem

When using nvm4w on Windows, cargo tauri android dev fails with:

  • "Cannot find module" errors
  • "node.exe.cmd" not found errors

Solution

  • Improved Windows executable detection in BuildTask.kt template
  • Added fallback logic: .cmd → .bat → cargo.exe → cargo
  • Maintains compatibility with existing setups

Testing

  • Generated BuildTask.kt contains fallback logic
  • Template properly handles cargo vs node executables
  • Needs contributors with full Android SDK to test build

Fixes #13892

Notes

  • Clippy passes with no warnings
  • One ACL snapshot test fails on Windows (unrelated to this change) this appears to be a platform-specific test issue. No ACL code was modified in this PR

- Fix Android build error on Windows when using nvm4w
- Add robust fallback logic for Windows executable detection
- Prevent 'node.exe.cmd' and 'Cannot find module' errors
- Graceful fallback to cargo when Node.js detection fails

Fixes tauri-apps#13892
@DomanskiFilip DomanskiFilip requested a review from a team as a code owner September 3, 2025 20:37
@github-project-automation github-project-automation bot moved this to 📬Proposal in Roadmap Sep 3, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 7, 2025

Package Changes Through 53160c4

There are 9 changes which include @tauri-apps/api with minor, tauri-cli with minor, tauri-utils with minor, tauri-runtime-wry with minor, tauri-runtime with minor, tauri with minor, tauri-bundler with minor, @tauri-apps/cli with minor, tauri-macros with patch

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
@tauri-apps/api 2.8.0 2.9.0
tauri-utils 2.7.0 2.8.0
tauri-bundler 2.6.1 2.7.0
tauri-runtime 2.8.0 2.9.0
tauri-runtime-wry 2.8.1 2.9.0
tauri-codegen 2.4.0 2.4.1
tauri-macros 2.4.0 2.4.1
tauri-plugin 2.4.0 2.4.1
tauri-build 2.4.1 2.4.2
tauri 2.8.5 2.9.0
@tauri-apps/cli 2.8.4 2.9.0
tauri-cli 2.8.4 2.9.0

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

Copy link
Member

@lucasfernog lucasfernog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice one, thanks!

@lucasfernog lucasfernog merged commit 19fb6f7 into tauri-apps:dev Oct 7, 2025
17 checks passed
@github-project-automation github-project-automation bot moved this from 📬Proposal to 🔎 In audit in Roadmap Oct 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🔎 In audit

2 participants