r/androiddev • • 3d ago

Open Source Stos - an open-source, Stack Exchange client built with Kotlin Multiplatform

1 Upvotes

Hi everyone!

I just released the first version of Stos, unofficial, open-source client for Stack Exchange network, built with Kotlin Multiplatform.

What it can do

- Switch between Stack Exchange sites

- Read questions, answers and comments with Markdown and LaTeX rendering

- Browse related questions and tags

- Open user profile and their posts

- English and Polish UI, light & dark theme

Current Limitations

It's read-only for now: no login, voting or posting yet. The Windows installer isn't code-signed, so SmartScreen may warn you.

Download and source

Github: https://github.com/Stos-project/Stos

Releases: https://github.com/Stos-project/Stos/releases/tag/v1.0.0

I'd really appreciate feedback, bug reports and feature ideas, especially on what you'd want from a Stack Exchange app before login and posting are added. Issues and PRs are welcome.

P.S. Stos doesn't have a logo yet. If you'd like to design one, open an issue in the repo with your proposal. The chosen author will be credited in the README.


r/androiddev • • 3d ago

Discussion How do you approach investigating memory leaks beyond what LeakCanary reports?

1 Upvotes

I've been spending quite a bit of time exploring Android memory debugging lately, particularly what happens after a leak has been detected.

LeakCanary does a great job of identifying leaks and showing the suspected reference paths. For common cases like a singleton holding an Activity, or a coroutine outliving its screen, the cause is often relatively straightforward.

But things get more interesting with long-running sessions.

For example, imagine a chat or video screen that's been open for 30–40 minutes. Memory usage gradually increases, objects remain reachable longer than expected, and eventually you need to capture a heap dump and investigate what's actually retaining those objects.

This was one of the areas I explored in my recent Droidcon India talk, Beyond Leak Detection: Building an End-to-End Memory Debugging Workflow Inside Android Studio.

I've been experimenting with Shark-based heap analysis, understanding object retention paths, and exploring ways to make the investigation process more actionable through IDE-integrated tooling and AI-assisted analysis. This work also led me to build an Android Studio plugin called LeakLens.

I'm interested in hearing how other Android developers handle these situations.

A few things I'm curious about:

  • When LeakCanary reports a leak, how much additional manual heap analysis do you typically perform?
  • Do you regularly use Shark directly, or rely on Android Studio's Memory Profiler?
  • How do you investigate leaks that only appear after extended sessions?
  • What's the most time-consuming part of your memory debugging workflow?

Not looking to compare tools as much as understand how people actually approach these problems in production.

Would love to hear about your experiences.


r/androiddev • • 4d ago

Open Source I built DroidSleuth, an open-source Android runtime investigation CLI. Looking for feedback from Android developers.

3 Upvotes

I've been working on DroidSleuth, a Go-based tool that uses ADB to record Android process activity, collect available crash/ANR evidence, and save everything to SQLite for offline investigation.

It supports two workflows:

  • An app already exited → collect Android's retained exit history.
  • Need to reproduce a problem → record the app's process activity and inspect the timeline afterward.

No root or companion Android app required.

I've tested it across Android emulators and on my Motorola running Android 17, but I'd like to know how it behaves on other OEM devices.

If anyone here develops Android apps and has a Linux machine, I'd appreciate feedback on:

  1. Does the installation and first-run experience make sense?
  2. Are the incident timelines actually useful?
  3. What information would you still need from ADB or Android Studio?

GitHub: https://github.com/KartikeyaKotkar/droidsleuth

It's early-stage, so critical feedback and bug reports are very welcome.


r/androiddev • • 3d ago

We need a Figma to Gemini plugin in Android Studio

0 Upvotes

I should be able to give Gemini a Figma url for Design content, and simply mention the section name on the board for it to implement the UI. Or perhaps, we need a plugin to link figma to Gemini in Android Studio. 


r/androiddev • • 4d ago

Open Source PhilPDF – a free, open-source PDF editor: edit text, fill, sign, scan + OCR (AGPL-3.0)

4 Upvotes

PhilPDF – an open-source PDF editor (Kotlin, Jetpack Compose, MuPDF). Edits text with the original font, forms, hand-drawn and certificate signatures, scanning with on-device OCR (Tesseract), cloud open and save. No ads, no account. AGPL-3.0. I'd love feedback on the editing UX. Source: https://github.com/PhilouElChapo/PhilPDF


r/androiddev • • 3d ago

Where can I sell my app without paying the $25 Google Play fee?

0 Upvotes

Hi everyone. I'm planning to build an app and sell it.

The $25 Google Play fee is a lot for me right now. I'm looking for other ways to sell an app before I start.

I'm thinking about:

• A web app (PWA) with payments through Stripe or PayPal

• Other stores like Samsung Galaxy Store or Amazon Appstore

Questions:

• Where else can I sell an app?

• Has anyone sold a PWA? Did it work?

• Which payment tool works best for small sellers?

Thanks for your help!


r/androiddev • • 4d ago

Question How do I actually publish an Internal Testing release?

2 Upvotes

I've uploaded the app bundle, but how to get to click on "Preview and Confirm"? I seem to be missing a button somewhere. I only see a "Discard app release" hyperlink.

<picture deleted>

RESOLVED: had to use Safari on my Mac in order for the footer containing the Save button to show up. Firefox and Edge on PC both failed to show the footer. It affected all forms of publishing, not just internal testing.

On all browsers, the warning popups all rendered without a background, so clearly these pages are only tested on Chrome, which I don't use.


r/androiddev • • 4d ago

I built WebView Inspector to inspect WebView URLs and navigation right inside Android apps

0 Upvotes

Hi everyone,

I built WebView Inspector, an Android library that adds a floating inspector to your app so you can see what your WebViews are loading.

It lets you:

  • Highlight a WebView in a card, banner, or full-screen page, inspect its query parameters, and copy its exact URL.
  • Review observed navigation history and revisit saved records after leaving the screen using Live / Recent.
  • Inspect the URL and headers your app supplied through an optional loadUrl helper.

My usual workflow was to search Logcat for the URL, copy it, and open it in Chrome to see what had loaded. That gets tedious when reproducing an issue, especially with multiple WebViews on the same screen. I wanted to check the URL and retrace navigation directly inside the app.

Basic inspection needs one installation in your Application. The optional load helper adds capture of app-supplied URLs and headers. Setup and usage

I see it fitting into the debugging workflow alongside these tools:

  • Chucker shows the Android app’s OkHttp requests and responses. Chucker
  • WebView Inspector shows which URL a particular WebView loaded and where it navigated.
  • Chrome DevTools shows requests made inside the web page, including fetch/XHR calls and their responses. WebView remote debugging

Navigation capture covers observed top-level URLs. Older WebView providers use sampling, which can miss fast redirects. Captured headers are the inputs your app supplied, and records stay in process memory. Capture details

Version 0.5.0 supports Android API 24+ and is available on Maven Central, with a matching no-op artifact for production builds. Release details

The repository includes the source code, integration instructions, and a sample app. Explore WebView Inspector on GitHub

I’d be interested to hear how others handle WebView URL debugging and which cases you find hardest to inspect.


r/androiddev • • 5d ago

Question What tools do you guys use to design professional high-end Android app UIs?

11 Upvotes

Hey everyone, I'm new to Android app development and looking for some advice. I've been using Android Studio, but honestly, its UI designer feels more like making a PowerPoint slide, not the high-end quality UIs that i see in other apps.

What tools do you guys use to create app UIs? And are there any good tutorials or guides you'd recommend for someone just starting out?


r/androiddev • • 4d ago

I made a native animated mascot/avatar for AI assistant UIs (Jetpack Compose + SwiftUI, 17 moods, MIT)

Post image
0 Upvotes

It's a touch-reactive bot avatar drawn with Canvas on both platforms, so no Lottie or video files to ship. It has 17 moods (Listening, Thinking, Speaking map to assistant turns), custom faces and SVG body shapes, and it respects reduced motion.

Repo and demo GIF: https://github.com/knowamit/interactive-bot-ui . Feedback on the API is very welcome.


r/androiddev • • 4d ago

One web interface; all ADB commands, LLM diagnostics, logging and security tools

0 Upvotes

So ever thought of having Android device workflows live in one browser tab instead of five terminals?

That's why I built AndruiTerminal: a local workstation for ADB, with a Rust backend and a React interface. It runs on your own Linux machine, listens only on 127.0.0.1, and never needs root.

In one place:

• Connect over USB or Wi-Fi, with a radar that spots nearby phones

• Screen mirroring, an interactive shell and live diagnostics

• App and file management, including a browser for app SQLite databases

• UI automation: OCR, image matching, record and replay, workflows

• Optional AI help through MCP, where risky actions wait for your approval

Try it, star it, or break it: https://github.com/tejaromalius/AndruiTerminal/


r/androiddev • • 5d ago

Anyone have any idea why my Android Studio emulator isn't refreshing the layout automatically when I save?

2 Upvotes

Literally just started using it.

EDIT:

For anyone else having this problem you have to click on the checkmark / cycle icon in the preview panel and select refresh automatically


r/androiddev • • 5d ago

Android developers: Native TTS vs. third-party speech engines for a commercial app?

3 Upvotes

I'm evaluating speech recognition and text-to-speech options for an Android project and would appreciate some real-world experience.

I'm particularly interested in:

  • The quality and consistency of Android's built-in TTS voices across different devices.
  • Whether Sherpa-ONNX, Piper, or other speech engines offer meaningful advantages.
  • Latency when combining cloud-based speech recognition with local TTS.
  • Reliability of interruptible speech playback.
  • Commercial licensing issues with open-source speech models.

For those who've worked with these technologies, which approaches have proven reliable, and which would you avoid?

I'm especially interested in solutions that minimize development complexity and recurring API costs.

Thanks for any practical advice or links to useful implementations.


r/androiddev • • 5d ago

Open Source I'm experimenting with an open-source Android flight recorder for diagnosing user-journey failures

1 Upvotes

Hey everyone!

I've been working on an open-source project called Argus - SystemSleuth.

The idea started with a problem I've encountered while thinking about application debugging:

When a user reports that something didn't work, a stack trace or API error often tells us where something failed, but not necessarily whag happened across the enire user journey.

For example:

A user selects a PDF, attaches it to an email and taps Send. The upload times out.

A conventional log might tell us that an HTTP request failed. But understanding the sequence of user actions, screen transitions and network events leading up to that failure can be equally important.

I'm exploring whether a structured runtime trace can make this kind of debugging easier.

What Argus currently explores:

● An in-memory, bounded flight recorder for capturing session events.

● Android Activity/Fragment lifecycle and user-interaction tracking.

● Network-event instrumentation through OkHttp.

● Session-level diagnostic analysis using AI providers, with a heuristic fallback.

● A sample Android app that reproduces an attachment-upload timeout and demonstrates the diagnostic flow.

A little context about it's current state:

This is still an early-stage experiment, not a production-ready observability SDK. The expected-workflow-versus-observed-execution comparison is also still a work in progress, rather than a fully integrated Android feature.

Privacy and sensitive-data handling need further work too, so I'd currently treat it as something to experiment with using test data rather than real user sessions.

Github: https://github.com/Deven264/Argus-SystemSleuth

It's liscensed under Apache 2.0.

I'd particularly appreciate feedback from people working on Android, debugging tools, observability or developer infrastructure.

  1. Do structured user-journey traces provide meaningful value beyond conventional logs and crash reports?
  2. Which events would you consider essential to capture when diagnosing application failures?
  3. What privacy safeguards would you expect before using a tool like this in a real application?

I'm sharing this to get honest technical feedback and improve the project. Criticism and suggestions are welcome!

Disclosure: I'm the developer of Argus.


r/androiddev • • 5d ago

Experience Exchange Takeaways after building an app and publishing it to Google Play

1 Upvotes

Hello,

My goal here is not to advertise my app. This is why I won't share its name. I would just like to share my experience building an app, from starting from scratch to publishing it to google play store.

I hope this share of experience will help someone. I know that most of the advice I'll share here will feel amateurish (because they are, indeed) but perhaps some amateurs might find them useful. I don't pretend that I know everything and I know that I have still much to learn.

Goal of the app: The initial idea was simple: Everyday, I watch videos to learn but never remember anything. The idea is you take a picture of a course, you share a youtube video link, upload a pdf file and this piece of knowledge is converted into cards that can be learned through spaced repetition. The exercises are generated "on the fly" so that you don't learn from the card content but are always truly tested for the specific content.

Stack

PartTechnologyWhy?
FrontReact NativeI thought it was more suited than flutter if I wanted in the future to make a web app, but I might be wrong.
Local DataBaseWatermelonDBIt makes it easier to sync a local database with supabase without using PowerSync.
BackSupabaseSupabase has a more generous free tier and I was afraid with the pay as you go pricing of firebase
AI (dev)Google Vertex AI(1) It's very fast and stable in comparison with other platforms I tried (azure and deepseek). (2) I has a 3-month trial with $300 credits (3) it's quite secure because you don't rely only on api keys (you can only accept requests from specific IP for ex). But the initial setup can be heavy.
AI (prod)OpenRouterIt's easier using open router to just switch from a claude model to a deepseek model, with the same price as the official platform. The only problem I had at first was reliability. The "nitro" mode allowing you to automatically select the best provider doesn't work well so I had to cherry-pick myself the best providers.

Some lessons I learnt

Don't develop directly. I might seem stupid by saying that, but the pleasure to develop could take the upper hand and you could miss so many important steps.

What I missed

  1. Might the app interest someone ? I know now that it might not interest anyone. When talking about it to other people, i most of the time feel ashamed by the uselessness of the idea. I think it is useful for my own use but I guess we're all very different.
  2. If so, who could be interested ? What is the potential customer ? From my part, I completely miss that students could be interested with it so all the functionalities I developed at first completely missed this target.
  3. Does any other app offer the same service ? I checked that after almost finishing the app. When comparing with the "competitors", I found many similarities with what my app.
  4. The app name : The initial name I took was already taken in every domain (.com, .app, etc.) and very expensive so I had to change it everywhere.
  5. Take the time to just design in a piece of paper (or whatever mean) what you want: All the menus, everything. It can take several days but you gain so much time afterwards.

Other lessons, but not from a mistake I made but more due to some principles I have

  • Help from AI: It's quite impossible to ignore the help of AI now. It's a very important help but don't let it take architectural decisions for you. Take the time to choose the schema of your database, the best stack for your need, how to organize your codebase.

Publishing the app

Everyone seems to talk about the compulsory 12-testers internal test to publish an app in google play.

  • This constraint is "only" for physical persons. If you're an organization, you're not required to do that. In France, you can just create what we call a "micro enterprise" (which is free in France). After accepting that your "company" gets listed in public repositories, you can get easily a "DUNS" number to get identified as an organization for google. I know the process is completely different across countries but it might be useful to check that out. Also, if you're french and need help, tell me (i got it to work!).
  • This is a useful constraint. After checking reddit posts, someone answered that, if you really want your app to work, doing an closed test is a basic step to get feedback to truly improve it. Take the time to consider really doing this step seriously.

Please, if you disagree with this post, or if you have anything to share, I am at your disposal.


r/androiddev • • 6d ago Bravo

Yalın — a Rust-based JSON parser optimized for Android ARM devices

Post image
45 Upvotes

I've been working on Yalın, a JSON parser written in Rust for Android.

It uses ARM NEON SIMD and tries to keep JNI calls to a minimum. The idea was to see how much performance I could get out of native parsing compared to existing Java libraries.

In benchmarks against fastjson2, selective field reads were up to 4.6x faster, while parsing a full 1 MB JSON tree was around 1.3x faster.

Small payloads are a different story. JNI overhead is still a bottleneck, and there's room for improvement.

Curious what other Android developers think about using Rust for this kind of thing, especially whether the performance gains are worth the native dependency.

https://github.com/0xberkay/yalin


r/androiddev • • 6d ago

Hiring for a Job [Hiring] Senior Android Engineer — Shenzhen, China (on-site)

1 Upvotes

A well-known internet company is hiring a hands-on Android engineer to build a personal communications product for global users. This is an on-site role in Shenzhen, China.

We are looking for an individual contributor who combines:

  • Maintenance, performance tuning or feature optimization on a large production app, with concrete examples involving startup time, memory, smoothness, crashes or ANRs.
  • End-to-end delivery experience: building an app from scratch, independently owning a complex business line within an established app, or delivering a major client architecture build or upgrade.

Requirements: a full-time bachelor's degree or above, 5+ years of Android development, strong Java/Kotlin, practical multithreading and performance-debugging experience, familiarity with modular/component-based architecture, and an app or core product area you have independently owned or led to production. Experience with e-commerce, short video, audio/video or consumer utility apps is relevant; a big-tech background is not required.

Practical use of AI coding tools, international products or IM development is a plus. This is a hands-on engineering role, not a management opening.

If interested, please send a private message with a short overview of a project you owned, the technical problems you solved and the results. Referrals are welcome.


r/androiddev • • 6d ago

Open Source Jetpack Compose version of Fade-out particle

Thumbnail github.com
9 Upvotes

Implemented the Jetpack Compose version of the fade-out particle animation, which was originally released for XML and wasn't supported in Compose at the time.


r/androiddev • • 7d ago

My engineering lead wants to commit API keys, etc to our repository, am I crazy for pushing back on this?

140 Upvotes

My lead wants to make it easier for anyone on the team to spin up the android repository (to make vibe coding easier), and their solution is to just check in all of our API keys into git and do away with the idea of keeping keys and secrets in a separate secrets vault that employees have access to.

At the last few startups I've worked at, we've pulled secrets in CI via environment secrets, and locally via a separate non-VCS file, and injected the keys into BuildConfig. I know BuildConfig is far from bulletproof for bad actors that want to decompile the app, but just checking everything into git "because it can just be decompiled anyway" is setting off all my alarms.

Am I crazy for pushing back on this? What are the best practices for this in 2026? Are people out there really encrypting API keys with KeyStore or pulling API keys from a backend server? How do you handle API keys that the application needs at startup?


r/androiddev • • 6d ago

15 Days of Google Play Verification: What I Learned

5 Upvotes

Today I finally received the email confirming that my identity was verified by Google Play Console! 🎉

It took 15 days, several attempts, countless emails, and quite a bit of frustration.

I wanted to share my experience because I know other developers, especially those outside the US and Europe, might run into similar problems.

My situation

I'm a developer from Lebanon, and this was a bigger challenge than I expected.

I don't have a passport or driver's license, and the standard Lebanese national ID doesn't have a photo.

Google requested a government-issued photo ID, so finding a document that met their requirements was already a challenge.

I started the verification process through Google's email, scanned the QR code, and submitted my information.

Then came the problems:

  • My identity verification was initially rejected because of a name mismatch.
  • I received different messages from Google Payments and Google Play Support.
  • I wasn't always sure which information or document needed to be corrected.
  • I made several attempts and exchanged multiple emails trying to understand what was wrong.

Eventually, after 15 days, I received the confirmation email.

What I learned and what I'd recommend

After going through this process, here are a few things I wish I'd known from the beginning:

1. Don't waste too much time asking for manual or special reviews.

At least in my experience, contacting support didn't result in a manual review or an alternative verification process. Don't assume support can bypass the standard requirements.

2. You need an acceptable identity document.

There is no workaround for the document requirement. If you don't have a document that satisfies Google's requirements, your verification is unlikely to succeed.

3. Don't keep guessing when something goes wrong.

If your verification gets rejected, understand the exact reason before submitting another attempt. Repeating the process without knowing what's wrong can waste time.

4. A driver's license is probably one of the most straightforward options.

If you have one, it may save you a lot of trouble compared with trying to find an alternative document that meets Google's requirements.

5. Pay attention to the language of your document.

This is something I wouldn't overlook. Make sure the information you enter in your Google account matches the document, including the name in the appropriate language and script. Don't assume that entering a translated or differently written version will be accepted.

What I'd do differently next time

I'd prepare my documents first, double-check that my account information matches them, and contact support before making repeated attempts if something doesn't meet the requirements.

Most importantly, I'd be more patient. The process can take time, and not every email means you need to start over.

Final thoughts

I'm sharing this because I know how frustrating identity verification can be, especially when you're a developer from a country where the available documents don't necessarily fit Google's standard requirements.

I'm not claiming to know exactly what made my verification successful, but I hope sharing my experience saves someone else a few days of frustration.

If you're going through the same process, feel free to ask questions. I'll share what I can from my experience.

And now... my app is one step closer to launch! 🚀


r/androiddev • • 7d ago

Open Source I built a draggable fast scrollbar for LazyColumn and lazy grids. One modifier, and it also works on iOS and desktop

29 Upvotes

Compose has no draggable scrollbar for lazy lists on Android or iOS (desktop has one).

There are a few community implementations, but none of the ones I tried handled feeds and chats well: the thumb would jump around when items had different heights, or when the next page loaded.

The hardest part was exactly that last one. When a page loads while you're dragging, the list grows under your finger, so the thumb used to jump away from it. Now the thumb stays where your finger is and only the mapping underneath changes, so you can still reach the end in the same drag.

Usage is one modifier on the list:

LazyColumn(
    state = listState,
    modifier = Modifier.scrollbar(listState),
) { ... }

Works on LazyColumn, LazyRow and both lazy grids.

Stuff I spent most of the time on:

  • dragging feels right even when items have different heights (thumb has a fixed length by default so it doesn't jitter around)
  • infinite feeds. Pass hasMore and the thumb won’t pretend you’re at the end while more pages can still load
  • gesture nav. The thumb is excluded from the back swipe so grabbing it doesn't send you back
  • no recompositions while scrolling or dragging

There's also an optional bubble that shows a letter/date while you drag (with a little haptic tick per section), you can use your own icon as the thumb, and it handles contentPadding, RTL and reverse layouts.

It's Compose Multiplatform so it also runs on iOS and desktop (desktop gets hover + click to jump), but it's just a regular Maven Central dependency if you only do Android.

One thing to know: lazy lists only know the size of items they've already measured, so with really uneven items the jump can land a bit off. It's best on long lists.

Needs Compose 1.10+, minSdk 24. Still 0.1.x so the API might change.

GitHub: https://github.com/Amaanprobably/compose-fast-scrollbar

I also created an easy guide with short videos everyone can follow -

Guide: https://github.com/Amaanprobably/compose-fast-scrollbar/blob/master/GUIDE.md

It's my first library so I'd really appreciate feedback, especially if you have a weird list setup (chats, paging, sticky headers, mixed grid spans).

If something breaks, an issue with a screen recording would help a ton.


r/androiddev • • 6d ago

News Android Studio Rabbit 2 Patch 2 now available

Thumbnail androidstudio.googleblog.com
3 Upvotes

r/androiddev • • 6d ago

News Android Studio Stingray 1 Canary 2 now available

Thumbnail androidstudio.googleblog.com
3 Upvotes

r/androiddev • • 7d ago

Play Console told me my R8 optimization was 48%. Turns out years of "scary R8 rules I didn't understand" doubled my DEX size (9.25 MB → 16.7 MB)

32 Upvotes

I have to confess something I suspect a lot of solo Android devs are quietly guilty of: R8 / ProGuard rules terrified me.

The syntax never clicked for me (-keepclassmembers, -keepclasseswithmembers, { *; }, ** vs *, -if...). Every time a release build crashed in production or threw a wall of R8 warnings, I'd panic, search StackOverflow or copy a "standard Android ProGuard file" from an old Medium post, paste in a -keep class something.** { *; }, see the build turn green, and vow never to touch proguard-rules.pro again.

Fast-forward a few years of migrating the app to Compose Multiplatform / Kotlin Multiplatform: my proguard-rules.pro was 437 lines long and still had rules for RxJava, Retrofit, Glide, and android.support — none of which were even in the project anymore.

This week, Google Play Console finally called me out on a new upload:

textImprove your app's memory and performance with R8 optimization
- Low optimization rate (48%)
- Low obfuscation rate (49%)
- Low shrinking rate (49%)

Instead of poking at rules blindly again, I let Gemini (in Antigravity / agy**)** inspect the actual R8 build artifacts (r8-metadata.dat, seeds.txt, and configuration.txt) and audit them against my codebase. Seeing what R8 was actually doing was humbling.

What was actually happening under the hood

In my build's seeds.txt (every class R8 is forbidden from shrinking/obfuscating/optimizing), 9,645 classes were pinned untouched — producing 2 DEX files totaling 16.70 MB.

Over 80% of those kept classes came from just a handful of panic-pasted blanket rules in my own proguard-rules.pro:

  • -keep class com.google.android.gms.internal.** { *; } → 3,416 classes
  • -keep class com.google.android.libraries.places.internal.** { *; } → 2,834 classes (meanwhile places:6.0.2 ALREADY ships 1,783 surgical consumer ProGuard rules of its own!)
  • -keep class kotlin.** { *; } → ~800+ stdlib classes
  • -keep class com.google.android.material.internal.** { *; } → 221 classes
  • -keep class com.firebase.ui.auth.** { *; } → 192 classes (my own reflection workaround only touched 3 specific classes!)
  • -keep class com.google.android.play.core.** { *; } → 140 classes
  • Plus -keepclassmembers enum * { *; }, -keep class my.app.data.** { *; } (even though kotlinx-serialization-core already ships full R8-friendly rules!), and 100+ lines of dead 2017 library rules.

The cleanup (437 lines → 59 lines)

We checked every library's bundled consumer rules in configuration.txt, grepped the codebase for every actual Class.forName / ServiceLoader call, and replaced the 437-line graveyard with ~59 surgical lines:

  1. Crashlytics line numbers (-renamesourcefileattribute SourceFile, -keepattributes SourceFile,LineNumberTable)
  2. The exact 4 classes/constructors accessed via Class.forName(...) in Application
  3. Coil 3's ServiceLoader target interfaces + constructors
  4. A small block of -dontwarn lines for optional JVM TLS/Ktor classes

Then we verified seeds.txt and usage.txt to make sure reflection targets, ServiceLoader entries, and kotlinx.serialization serializers were all preserved.

Before vs. After (from r8-metadata.dat)

MetricBeforeAfterChange
Optimization rate48.67%86.39%+37.7 pts
Obfuscation rate49.14%87.07%+37.9 pts
Shrinking rate49.13%87.10%+38.0 pts
DEX bytecode16.70 MB (2 DEX)9.25 MB (1 DEX!)-44.6% (-7.45 MB)
Seeded classes9,6451,608-83.3%

(Most of the remaining ~13% comes from com.google.android.recaptcha:18.6.1*'s own AAR consumer rules keeping* recaptcha.***,* play.core.integrity.***, and* okhttp3.***.)*

Bonus plot twist that made me laugh

I uploaded the new .aab to Play Console — the R8 warning disappeared immediately! ...and was replaced by a new Play Console warning:

Your app uses deprecated APIs for edge-to-edge (Window.setStatusBarColor / setNavigationBarColor) starting in sv1.b, uv1.b, wv1.b.

I deobfuscated sv1, uv1, wv1 in mapping.txt:

  • sv1 → androidx.activity.EdgeToEdgeApi26
  • uv1 → androidx.activity.EdgeToEdgeApi29
  • wv1 → androidx.activity.EdgeToEdgeApi35

They're Google's own Jetpack enableEdgeToEdge() compatibility classes! Before the fix, they were un-obfuscated so Play's scanner ignored them; once R8 actually obfuscated them, Play's static analyzer stopped recognizing its own AndroidX library.

5 things I wish I'd known earlier (to avoid the same trap)

  1. You can check your R8 score locally in 5 seconds. Look at app/build/intermediates/r8_metadata/release/minifyReleaseWithR8/r8-metadata.dat — it literally contains the exact noOptimizationPercentage / noObfuscationPercentage / noShrinkingPercentage numbers Play Console uses.
  2. Group seeds.txt by package prefix. A 10-line Python script counting top packages in app/build/outputs/mapping/release/seeds.txt immediately exposes which -keep rule is quietly locking thousands of classes.
  3. Check configuration.txt before adding any third-party -keep rule. Modern AARs (places, material, credentials, kotlinx-serialization, play-services-*) almost always ship their own surgical rules. Adding a blanket -keep class com.library.** { *; } overrides all of their careful optimization.
  4. Never confuse -dontwarn with -keep**.** -dontwarn just tells R8 "yes, this optional JVM class isn't on Android, don't fail the build" and costs 0 bytes. -keep class foo.** { *; } turns off shrinking, obfuscation, and optimization for the entire package tree.
  5. If you inherited a "starter ProGuard file" from a blog post pre-2020, burn it. Start from proguard-android-optimize.txt, grep your own repo for Class.forName, ServiceLoader, and reflection-based JSON/Parcelable models, and add only what fails or is explicitly missing in seeds.txt.

Hope this saves someone else from accidentally shipping 7.5 MB of un-shrunk Play Services and Kotlin stdlib bytecode!