forwardemail / forwardemail/mail.forwardemail.net

Reduce Android APK size

Open
#115 0 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
36
Forks
8
PR merge metrics
No merged PRs in 30d

Description

The current Android release APK size is 183 MB (while iOS IPA is 7 MB). The distribution of Universal APKs bundles multiple architecture binaries into a single file. Packaging these multi-ABI binaries alongside unstripped release artifacts contributes directly to this overhead.

### Proposed Optimizations

#### 1. ABI Splitting via GitHub Actions (`tauri-action`)

The CI/CD pipeline utilizes `tauri-apps/tauri-action`. Modifying the workflow `.yml` file to pass the `--split-per-abi` argument generates individual, smaller APKs per architecture (`arm64-v8a`, `armeabi-v7a`, `x86`, `x86_64`).

```yaml
- name: Build Tauri app
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: --split-per-abi

```

#### 2. Rust Cargo Release Profile (`src-tauri/Cargo.toml`)

Enable Link-Time Optimization (LTO), symbol stripping, and size optimization for release builds to reduce the size of the compiled `.so` binaries.

```toml
[profile.release]
opt-level = "z"
lto = true
codegen-units = 1
panic = "abort"
strip = true

```

#### 3. ProGuard / R8 & Resource Shrinking

Enable code and resource shrinking in `src-tauri/gen/android/app/build.gradle` to eliminate unused Java/Kotlin code and Android resources.

```gradle
android {
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}

```

#### 4. NDK Binary Stripping

Verify that the Android NDK `llvm-strip` utility executes across all `.so` shared libraries during the CI/CD release workflow to remove remaining symbols and debug sections.

---

### Expected Outcome

Target package sizes per architecture are expected to decrease from 183 MB to 15 MB – 30 MB.

Contributor guide

Open the contributing guide

Research direction

Start by reading the Android release workflow that invokes tauri-apps/tauri-action, then inspect src-tauri/Cargo.toml and src-tauri/gen/android/app/build.gradle. Build or review the release artifacts to establish their current sizes and verify ABI splitting, release optimization, resource shrinking, and NDK stripping. Done means separate architecture APKs are produced and their sizes approach the stated 15–30 MB target.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, github-actions, rust, tauri
Domain
build-system, ci-cd, mobile
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.