---
title: "Discussion on \"Static, Finally: Moving Android Code from Companion Objects to Companion Blocks\" | Hashnode"
description: "Discussion on \"Static, Finally: Moving Android Code from Companion Objects to Companion Blocks\". Companion blocks compile to static members, but migrating can break Java callers, R8 rules, reflection, and library releases."
url: "https://hashnode.com/posts/static-finally-moving-android-code-from-companion-objects-to-companion-blocks/6af4a6a0ae2fca06ce92fc37"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Static, Finally: Moving Android Code from Companion Objects to Companion Blocks](https://android-expert.hashnode.dev/static-finally-moving-android-code-from-companion-objects-to-companion-blocks?utm_source=hashnode&utm_medium=feed)

Companion blocks compile to static members, but migrating can break Java callers, R8 rules, reflection, and library releases.

1d ago · 10 min read · android-expert.hashnode.dev  
Read the article

-   [#android](https://hashnode.com/tag/android)
-   [#kotlin](https://hashnode.com/tag/kotlin)
-   [#java](https://hashnode.com/tag/java)
-   [#companionobjects](https://hashnode.com/tag/companionobjects)

## Written by

[Android Expert](https://hashnode.com/@android-expert)

@android-expert · Chennai, India

  
[View profile](https://hashnode.com/@android-expert)

Android Expert· Kotlin, Jetpack Compose & production pitfalls

Android Engineer &amp; Kotlin Advocate. 🚀 Deep dives into Jetpack Compose, Coroutines, and Clean Architecture. Turning complex code into scalable solutions. 🛠️✨

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
