<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Vikas Soni</title>
    <description>The latest articles on Forem by Vikas Soni (@vikas_soni).</description>
    <link>https://forem.com/vikas_soni</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2911616%2F34baa62c-6c42-43fc-bd0d-cab3aed346dc.jpg</url>
      <title>Forem: Vikas Soni</title>
      <link>https://forem.com/vikas_soni</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/vikas_soni"/>
    <language>en</language>
    <item>
      <title>I Audited Google’s “Now in Android” Build Architecture (Here is what I found)</title>
      <dc:creator>Vikas Soni</dc:creator>
      <pubDate>Mon, 11 May 2026 20:02:33 +0000</pubDate>
      <link>https://forem.com/vikas_soni/i-audited-googles-now-in-android-build-architecture-here-is-what-i-found-26ll</link>
      <guid>https://forem.com/vikas_soni/i-audited-googles-now-in-android-build-architecture-here-is-what-i-found-26ll</guid>
      <description>&lt;p&gt;The Black Box of Gradle Builds As Android applications grow, they inevitably turn into deeply nested, multi-module mazes. You start with a clean architecture, but fast forward 6 months, and you are staring at a 5-minute build time, wondering where it all went wrong.&lt;/p&gt;

&lt;p&gt;Is it a circular dependency? Is a rogue module breaking the Configuration Cache? Are we still running KAPT when we don’t need to?&lt;/p&gt;

&lt;p&gt;For a long time, answering these questions required digging through Gradle build scans and manually tracking build.gradle files. Web developers have had "Google Lighthouse" for years to instantly audit their site’s health. I realized Android developers needed the exact same thing for their build systems.&lt;/p&gt;

&lt;p&gt;So, I built Gradle Lighthouse — an open-source, zero-configuration build intelligence plugin.&lt;/p&gt;

&lt;p&gt;To test if it was truly enterprise-ready, I decided to point it at the gold standard of modern Android architecture: Google’s Now in Android (NIA) repository.&lt;/p&gt;

&lt;p&gt;The Experiment: Auditing “Now in Android”&lt;br&gt;
The Now in Android app is Google’s official showcase for modern Android development. It uses Jetpack Compose, a highly modularized architecture, and Kotlin Multiplatform. It is the perfect stress test.&lt;/p&gt;

&lt;p&gt;I added the Gradle Lighthouse plugin to NIA’s root build.gradle.kts (it only takes one line) and ran ./gradlew lighthouseAudit.&lt;/p&gt;

&lt;p&gt;The engine ran 20+ architectural checks across the entire module graph. I expected a perfect score. I was wrong.&lt;/p&gt;

&lt;p&gt;The Results: NIA Scored a 50/100 (“At Risk”)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7cb0gkhlt0i2nfy9t7jv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7cb0gkhlt0i2nfy9t7jv.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The NIA project received an overall Architecture Score of 50/100, placing it in the “At Risk” rank.&lt;/p&gt;

&lt;p&gt;Wait, how is the official Google showcase app at risk? Lighthouse runs an incredibly strict set of rules. Here are the most fascinating flaws it uncovered in NIA’s build scripts:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Configuration Cache Blockers (allprojects anti-pattern) Lighthouse immediately flagged a critical error: the root build.gradle.kts uses allprojects{} or subprojects{} blocks.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The Impact: This forces Gradle to eagerly configure every single module, even if you are only building one. It actively blocks migration to the Configuration Cache and the upcoming Isolated Projects feature in Gradle 9.x.&lt;br&gt;
The Fix: Replacing this with convention plugins reduces configuration time by 50–90%.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The “Dark Module” Test Lighthouse scans for “Dark Modules” — modules that exist in the graph but have absolutely zero test files. The root nowinandroid module was flagged as a completely untested risk vector. In large enterprise projects, these dark modules accumulate over time and make safe refactoring impossible.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Subscribe to the Medium newsletter&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Version Catalog Clutter &amp;amp; Bundle Opportunities NIA uses a modern libs.versions.toml file, but Lighthouse found two major areas for hygiene improvement:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Unused Entries: The catalog defines 103 library entries, but Lighthouse warned that several appear to be unused across the graph, creating unnecessary noise during dependency upgrades.&lt;br&gt;
Missed Bundles: Lighthouse found 9 bundle opportunities. For instance, NIA declares 50 different androidx libraries and 3 coil libraries individually across modules, instead of grouping them into [bundles] for cleaner, safer dependency management.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Security and Reproducibility Blindspots Finally, Lighthouse flagged two easily fixable security and stability issues:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;No Dependency Locking: NIA doesn’t use dependencyLocking. This means a transitive dependency could be silently upgraded to a compromised version between builds.&lt;br&gt;
No JDK Toolchain: The build scripts lack a pinned JVM Toolchain (kotlin { jvmToolchain(17) }), which can lead to inconsistent bytecode across different developers' machines.&lt;br&gt;
The Takeaway for Your App&lt;br&gt;
Google’s Now in Android is a fantastic repository, but it proves a crucial point: As a project scales, build hygiene degrades silently.&lt;/p&gt;

&lt;p&gt;The difference between a legacy app and a highly scalable one is often just 50ms of build time compounded over 100 modules. But you can’t fix what you can’t measure.&lt;/p&gt;

&lt;p&gt;Get Your Lighthouse Score&lt;br&gt;
I built Gradle Lighthouse to be completely free, open-source, and plug-and-play. If you want to see your project’s score and find out exactly why your builds are slow, it takes exactly one line of code.&lt;/p&gt;

&lt;p&gt;Add this to your build.gradle.kts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight gradle"&gt;&lt;code&gt;&lt;span class="n"&gt;plugins&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"io.github.dev-vikas-soni.lighthouse"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="n"&gt;version&lt;/span&gt; &lt;span class="s2"&gt;"2.1.1"&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./gradlew lighthouseAudit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check out the repository here, and let me know what score your project gets!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/dev-vikas-soni/gradle-lighthouse" rel="noopener noreferrer"&gt;🔗 GitHub: Gradle Lighthouse&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;(⭐️ If this tool helps you clean up your build graph and save time, I’d deeply appreciate a star on GitHub to help the open-source project grow!)&lt;/p&gt;

</description>
      <category>android</category>
      <category>architecture</category>
      <category>performance</category>
      <category>tooling</category>
    </item>
    <item>
      <title># Building a Production-Ready Kotlin Multiplatform SDK (Android + iOS)</title>
      <dc:creator>Vikas Soni</dc:creator>
      <pubDate>Tue, 05 May 2026 18:42:53 +0000</pubDate>
      <link>https://forem.com/vikas_soni/-building-a-production-ready-kotlin-multiplatform-sdk-android-ios-250a</link>
      <guid>https://forem.com/vikas_soni/-building-a-production-ready-kotlin-multiplatform-sdk-android-ios-250a</guid>
      <description>&lt;p&gt;Kotlin Multiplatform is no longer “experimental curiosity” — it’s a serious choice for production apps.&lt;/p&gt;

&lt;p&gt;Companies like Netflix, Cash App, and McDonald's are already using it to share business logic across platforms while keeping native UI experiences intact (&lt;a href="https://levntech.com/blog/kotlin-multiplatform-guide?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;LevnTech&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;In this post, I’ll walk through how I built a &lt;strong&gt;production-ready Kotlin Multiplatform SDK&lt;/strong&gt; that works seamlessly across Android and iOS — along with the real challenges, trade-offs, and lessons learned.&lt;/p&gt;




&lt;h2&gt;
  
  
  🤔 Why Kotlin Multiplatform?
&lt;/h2&gt;

&lt;p&gt;Unlike Flutter or React Native, Kotlin Multiplatform doesn’t try to replace native development.&lt;/p&gt;

&lt;p&gt;Instead, it lets you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Share business logic (networking, caching, models)&lt;/li&gt;
&lt;li&gt;Keep native UI (Jetpack Compose / SwiftUI)&lt;/li&gt;
&lt;li&gt;Avoid code duplication&lt;/li&gt;
&lt;li&gt;Maintain near-native performance&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This approach is powerful because you’re not forced into an “all-or-nothing” architecture — you can adopt it gradually (&lt;a href="https://www.infoq.com/articles/kotlin-multiplatform-evaluation/?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;InfoQ&lt;/a&gt;).&lt;/p&gt;




&lt;h2&gt;
  
  
  🧱 Project Architecture
&lt;/h2&gt;

&lt;p&gt;A typical KMP setup looks like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Android App&lt;/strong&gt; → Uses shared module&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;iOS App&lt;/strong&gt; → Consumes Kotlin framework&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Shared Module&lt;/strong&gt; → Business logic&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Kotlin compiles your shared code into:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A native framework for iOS&lt;/li&gt;
&lt;li&gt;A standard module for Android&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This means no bridges, no JavaScript layer — just native performance (&lt;a href="https://dev.to/bugfenderapp/how-to-debug-a-kotlin-multiplatform-mobile-app-from-scratch-2719?utm_source=chatgpt.com"&gt;DEV Community&lt;/a&gt;).&lt;/p&gt;




&lt;h2&gt;
  
  
  🚀 What I Built
&lt;/h2&gt;

&lt;p&gt;The goal was simple:&lt;/p&gt;

&lt;p&gt;👉 Create a &lt;strong&gt;production-grade SDK&lt;/strong&gt; that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Can be reused across apps&lt;/li&gt;
&lt;li&gt;Is easy to integrate&lt;/li&gt;
&lt;li&gt;Handles real-world concerns (networking, error handling, scalability)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  ⚙️ Key Challenges (and How I Solved Them)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. API Design for Two Worlds
&lt;/h3&gt;

&lt;p&gt;Designing an SDK that feels “native” on both Android and iOS is harder than it sounds.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Keep APIs minimal and platform-agnostic&lt;/li&gt;
&lt;li&gt;Use expect/actual wisely&lt;/li&gt;
&lt;li&gt;Avoid leaking platform-specific abstractions&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  2. Dependency Management
&lt;/h3&gt;

&lt;p&gt;Not all libraries are multiplatform-ready.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Prefer KMP-compatible libraries (e.g., Ktor)&lt;/li&gt;
&lt;li&gt;Abstract dependencies behind interfaces&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  3. iOS Interoperability
&lt;/h3&gt;

&lt;p&gt;Swift + Kotlin interop can get tricky.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Design Swift-friendly APIs&lt;/li&gt;
&lt;li&gt;Avoid overly complex generics&lt;/li&gt;
&lt;li&gt;Test from Xcode early, not later&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  4. Build &amp;amp; CI Complexity
&lt;/h3&gt;

&lt;p&gt;KMP builds can become slow and complex.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Optimize Gradle configuration&lt;/li&gt;
&lt;li&gt;Separate concerns into modules&lt;/li&gt;
&lt;li&gt;Cache aggressively in CI&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧪 Production Learnings
&lt;/h2&gt;

&lt;p&gt;After taking this setup closer to production, a few things stood out:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can realistically share &lt;strong&gt;70–80% of business logic&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Debugging is manageable with standard tools&lt;/li&gt;
&lt;li&gt;The biggest gains come from &lt;strong&gt;team alignment&lt;/strong&gt;, not just code reuse&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📦 When Should You Use KMP?
&lt;/h2&gt;

&lt;p&gt;Kotlin Multiplatform is a great fit if:&lt;/p&gt;

&lt;p&gt;✅ You have both Android and iOS apps&lt;br&gt;
✅ Your business logic is complex and shared&lt;br&gt;
✅ You want native UI but shared architecture&lt;/p&gt;

&lt;p&gt;Avoid it if:&lt;br&gt;
❌ Your app is UI-heavy with little shared logic&lt;br&gt;
❌ Your team lacks Kotlin experience&lt;/p&gt;




&lt;h2&gt;
  
  
  💡 Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Kotlin Multiplatform hits a sweet spot:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Not a full abstraction layer&lt;/li&gt;
&lt;li&gt;Not fully separate codebases&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It gives you &lt;strong&gt;shared logic where it matters&lt;/strong&gt;, without sacrificing native quality.&lt;/p&gt;

&lt;p&gt;If you're building something meant to scale across platforms, it’s absolutely worth considering.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔗 Full Article
&lt;/h2&gt;

&lt;p&gt;If you want the complete deep dive with implementation details, check it out here:&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://medium.com/proandroiddev/building-a-production-ready-kotlin-multiplatform-sdk-for-android-ios-0044cd5d1baf" rel="noopener noreferrer"&gt;https://medium.com/proandroiddev/building-a-production-ready-kotlin-multiplatform-sdk-for-android-ios-0044cd5d1baf&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🙌 Feedback
&lt;/h2&gt;

&lt;p&gt;If you're working with Kotlin Multiplatform or planning to, I’d love to hear your experience.&lt;/p&gt;

&lt;p&gt;What’s been your biggest challenge so far?&lt;/p&gt;

</description>
      <category>android</category>
      <category>kotlin</category>
      <category>multiplatform</category>
      <category>mobile</category>
    </item>
  </channel>
</rss>
