Skip to content

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

Merged
lucasfernog merged 3 commits into
tauri-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 into
tauri-apps:devfrom
DomanskiFilip:fix-android-nvm4w-windows

Conversation

@DomanskiFilip

Copy link
Copy Markdown
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-actions

github-actions Bot commented Oct 7, 2025

Copy link
Copy Markdown
Contributor

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

@lucasfernog lucasfernog left a comment

Copy link
Copy Markdown
Member

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants