top of page
Search

From .exe to .apk: Wrapping the Same App for Android

Writer: Chrissy
Chrissy
Oct 17
3 min read

I already had a working portable .exe. Same React frontend, same Tauri wrapper. Now I wanted the same thing on my tablet — a single file I copy over, tap, and install. No app store, no gatekeepers, no $25 Google fee.

One codebase. Two outputs. Here's what actually went wrong.


The Setup

The idea is simple: Tauri v2 supports Android. You run npx tauri android init (once) and npx tauri android build (every time you want a new .apk). The .apk goes in src-tauri/gen/android/app/build/outputs/apk/release/.

The catch: Tauri needs the Android SDK, NDK, and Java. All of that comes with Android Studio. So step one is installing it.


Hiccup 1: The SDK Path

Android Studio's first-run setup tried to install the SDK at the filesystem root. Error:

The Android SDK location cannot be at the filesystem root.

Fix: Changed the path to C:\Users\msisd\AppData\Local\Android\Sdk. Standard location. Moved on.


Hiccup 2: JAVA_HOME

Ran npx tauri android init. Failed immediately:

failed to ensure Android environment: Java not found in PATH,
default Android Studio Java installation not found at
C:\Program Files\Android\Android Studio\jbr and JAVA_HOME
environment variable not set.

I assumed Android Studio installed to the per-user path (C:\Users\msisd\AppData\Local\Programs\Android Studio\). It didn't. It went to C:\Program Files\Android\Android Studio\.


Fix:

Get-ChildItem -Path "C:\Program Files" -Filter "jbr" -Recurse -Directory | Select-Object FullName

Found it: C:\Program Files\Android\Android Studio\jbr

$env:JAVA_HOME = "C:\Program Files\Android\Android Studio\jbr"

Hiccup 3: Skipping a Step

Got excited, set JAVA_HOME, and ran npx tauri android build directly. Skipped init.

Android Studio project directory C:\...\src-tauri\gen/android
doesn't exist. Please run `tauri android init` and try again.

Fix: Run npx tauri android init first. It creates the gen/android/ folder structure that build expects. Obvious in hindsight.


Hiccup 4: The Symlink

init succeeded. build got through compiling the Rust code, copying the .so file, then died:

Creation symbolic link is not allowed for this system.
For Windows 10 or newer: You should use developer mode.

Windows blocks symlink creation by default. Tauri uses symlinks to link the compiled Rust library into the Android project structure.


Fix:

Settings → System → For developers → toggle ON Developer Mode → restart.

Re-ran npx tauri android build. Finished. .apk appeared in src-tauri/gen/android/app/build/outputs/apk/release/.


The Result

Step

Command

What it does

One-time

npx tauri android init

Creates the Android project structure in src-tauri/gen/android/

Every build

npx tauri android build

Compiles Rust + embeds frontend → produces .apk

The .exe and .apk coexist in the same project. npx tauri build still produces the Windows .exe. npx tauri android build produces the Android .apk. Same seed.ts, same kb.ts, same React components. Different wrapper.


Getting it on the tablet: Copy the .apk via USB → tap it → "Allow unknown sources" → Install. Done. No store, no account, no review.


What I didn't have to do:

  • Rewrite any React code

  • Change the frontend

  • Touch seed.ts or kb.ts

  • Set up a Google Play Developer account

  • Pay $25

  • Wait for a store review

The only "new" code was zero. The entire Android app is the same codebase in a different wrapper.


Stack (unchanged): TanStack Start · React · Tailwind · Tauri v2 · Rust


Key takeaway: Tauri's mobile support is real but rough around the edges. The build works, but it assumes you know where JAVA_HOME should point, that you've run init before build, and that your OS allows symlinks. Three small assumptions, three hours of Googling for a beginner. Once they're cleared, the actual build is one command.



 
 
 

Comments


© 2025 by Chrissy. Powered and secured by Wix

bottom of page