expo-ruler
v0.2.2
Published
Expo config plugin for Spotify Ruler.
Downloads
1,241
Maintainers
Readme
expo-ruler
expo-ruler is an Expo config plugin that configures Spotify Ruler for Android projects generated with npx expo prebuild.
Spotify Ruler is a Gradle plugin for analyzing Android app size.
Installation
npx expo install expo-rulerAdd the plugin to app.json:
{
"expo": {
"plugins": ["expo-ruler"]
}
}Usage
Run the analyze<VariantName>Bundle task that Ruler adds for each app variant:
cd android && ./gradlew app:analyzeReleaseBundleThe HTML (report.html) and JSON (report.json) reports are written to android/app/build/reports/ruler/release/.
If your project defines custom build variants, list the available Ruler tasks with:
cd android && ./gradlew tasks --group="Ruler"Options
All options are optional. The defaults describe a modern high-density ARM64 device, override to match your users.
| Option | Type | Default | Description |
| --------------- | -------- | ---------------- | ------------------------------------------------------------------------ |
| abi | string | "arm64-v8a" | Target ABI. One of "arm64-v8a", "armeabi-v7a", "x86", "x86_64". |
| locale | string | "en" | Target locale. |
| screenDensity | number | 480 | Target screen density in dpi. |
| sdkVersion | number | 36 | Target Android SDK version (API level). |
| rulerVersion | string | "2.0.0-beta-3" | Spotify Ruler Gradle plugin version to install. |
Compatibility
Spotify Ruler requires Gradle 8+, Android Gradle Plugin 8+, and JDK 17, which ships with Expo SDK 50 and newer.
