Skip to main content

Android APK Analyzer: Manifest, Permissions & Size Guide

Use Android Studio's APK Analyzer to inspect what's inside your APK or AAB, understand permission declarations, read DEX class structure, and apply R8 shrinking to reduce app size for Google Play.

✓ APK vs AAB explained ✓ Manifest permission audit ✓ R8/ProGuard shrinking ✓ Size reduction techniques

APK vs AAB: Which to Use

Feature APK AAB (Android App Bundle)
Required by Play Store Legacy apps only Yes, for new apps since 2021
Delivered size Same for all devices Optimized per device (smaller)
Direct install Yes (adb install) No (requires bundletool or Play Store)
Average size reduction Baseline 15–65% smaller download
Dynamic feature modules No Yes

Using APK Analyzer in Android Studio

Open APK Analyzer from the menu: Build > Analyze APK... and select your .apk or .aab file. You'll see a breakdown of every file and its raw and download size.

# Build a release APK for analysis
cd android
./gradlew assembleRelease

# The APK is at:
# android/app/build/outputs/apk/release/app-release.apk

# Or build an AAB (for Play Store):
./gradlew bundleRelease
# android/app/build/outputs/bundle/release/app-release.aab

# Analyze from command line with bundletool
java -jar bundletool.jar dump manifest --bundle=app-release.aab
java -jar bundletool.jar dump resources --bundle=app-release.aab

Reading AndroidManifest.xml Permissions

In APK Analyzer, click AndroidManifest.xml to see all declared permissions. Review each one for necessity:

<!-- AndroidManifest.xml — permission examples -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

  <!-- Required for any network access -->
  <uses-permission android:name="android.permission.INTERNET" />

  <!-- Runtime permission — user must approve -->
  <uses-permission android:name="android.permission.CAMERA" />

  <!-- maxSdkVersion limits to older OS versions -->
  <uses-permission
    android:name="android.permission.READ_EXTERNAL_STORAGE"
    android:maxSdkVersion="32" />

  <!-- Precise vs approximate location -->
  <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
  <!-- Only add FINE_LOCATION if you truly need GPS precision -->

</manifest>

Permissions added automatically by third-party libraries (called "permission leakage") are a common issue. Add tools:node="remove" to strip permissions added by libraries you can't modify:

<manifest xmlns:tools="http://schemas.android.com/tools">
  <!-- Remove a permission added by a library -->
  <uses-permission
    android:name="android.permission.READ_PHONE_STATE"
    tools:node="remove" />
</manifest>

Reducing APK Size with R8 and Resource Shrinking

Enable R8 code shrinking and resource shrinking in your release build configuration:

// android/app/build.gradle
android {
    buildTypes {
        release {
            minifyEnabled true         // Enable R8 shrinking + obfuscation
            shrinkResources true       // Remove unused resources
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),
                          'proguard-rules.pro'
        }
    }

    // Exclude specific ABIs to reduce native library size
    // Include only the architectures you target
    splits {
        abi {
            enable true
            reset()
            include 'arm64-v8a', 'armeabi-v7a'  // Covers 99%+ of Android devices
            universalApk false
        }
    }
}

Analyze DEX Method Count

In APK Analyzer, click on a .dex file to see a tree view of all packages and their method counts. If you're approaching the 64K limit, R8 shrinking is the primary solution:

# Check method count from command line
# Install dx tool (part of Android SDK build-tools)
dx --dex --output=temp.dex classes.dex 2>&1 | grep "method count"

# Or use dexcount-gradle-plugin to get method count in CI
# In build.gradle:
# apply plugin: 'com.getkeepsafe.dexcount'
# Run: ./gradlew assembleRelease
# Check: app/build/outputs/dexcount/

Frequently Asked Questions

What is Android APK Analyzer?▼

APK Analyzer is a built-in tool in Android Studio (Build > Analyze APK) that inspects the contents of an APK or AAB file. It shows the size of each component (DEX files, resources, native libraries, AndroidManifest.xml), lists all declared permissions, and shows the method count per DEX file. It's the first tool to open when investigating APK size issues.

What is the difference between APK and AAB?▼

APK (Android Package) is the traditional distribution format — a single file containing all code and resources for all device configurations. AAB (Android App Bundle) is Google's newer format that lets the Play Store generate optimized APKs per device. AAB results in smaller downloads because users only receive the code and resources for their specific device, language, and screen density. The Play Store now requires AAB for new apps.

How do I read AndroidManifest.xml permissions?▼

In APK Analyzer, click on AndroidManifest.xml to see the decoded XML. Look for <uses-permission> elements — each one is a permission your app declares. Review every permission: INTERNET (network), CAMERA, READ_CONTACTS, and ACCESS_FINE_LOCATION are the most sensitive. Remove any permissions not actively used, as users and app stores scrutinize the declared permission list.

What is ProGuard/R8 and how does it reduce APK size?▼

R8 is the Android code shrinker and obfuscator (it replaced ProGuard in Android Gradle Plugin 3.4). When enabled, R8 removes unused classes, methods, and fields (shrinking), renames identifiers to short names (obfuscation), and applies code optimizations. Together these can reduce DEX size by 30–60%. Enable with minifyEnabled = true in your release build configuration.

How do I reduce my APK/AAB size?▼

Key strategies: (1) Enable R8 shrinking with minifyEnabled = true. (2) Enable resource shrinking with shrinkResources = true. (3) Use Android App Bundle (AAB) instead of APK. (4) Compress and convert images to WebP. (5) Use vector drawables instead of raster images where possible. (6) Audit your dependencies — many bring in large transitive dependencies. (7) Use ABI splits or ABIs filter to exclude unnecessary native library architectures.

What is a DEX file and why does method count matter?▼

DEX (Dalvik Executable) is the bytecode format for Android apps. Each DEX file has a hard limit of 65,536 method references (the '64K limit'). When your app exceeds this, you need multidex, which splits code into multiple DEX files. Multidex increases startup time on older Android versions. R8 shrinking typically reduces your method count significantly, helping avoid or minimize multidex overhead.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$9/mo after trial · Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →