Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 17, 2025

Non-fatal TimeoutException in android.content.res.ResourcesImpl$ThemeImpl.finalize() is a known Android framework bug where theme objects accumulate faster than GC can finalize them when apps extensively use dynamic theming (36 activities + 16 bottom sheets in this codebase). No application-level fix exists.

Changes

  • Themes.kt: Added KDoc documenting the framework limitation and confirming app follows best practices (single theme application per activity/dialog, proper cleanup in onDestroyView)
  • proguard-rules.pro: Added comment documenting the issue for build configuration reference

Both reference this issue for future developers encountering the exception.

Why documentation-only

Current implementation already optimal:

  • theme.applyStyle() once per onCreate() before super.onCreate()
  • Bottom sheets override getTheme() (correct pattern)
  • View bindings nulled in lifecycle cleanup

Alternative approaches (setTheme() instead of applyStyle()) incompatible with Material Design theming. Exception is non-fatal, already tracked via Firebase.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.13-all/54h0s9kvb6g2sinako7ub77ku/gradle-8.13/lib/gradle-daemon-main-8.13.jar -javaagent:/home/REDACTED/.gradle/wrapper/dists/gradle-8.13-all/54h0s9kvb6g2sinako7ub77ku/gradle-8.13/lib/agents/gradle-instrumentation-agent-8.13.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.13 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>v055u: TimeoutException in ThemeImpl.finalize() timed out after 60 seconds</issue_title>
<issue_description>```hs
Non-fatal Exception: java.util.concurrent.TimeoutException: android.content.res.ResourcesImpl$ThemeImpl.finalize() timed out after 60 seconds
at android.content.res.AssetManager.releaseTheme(AssetManager.java:1079)
at android.content.res.ResourcesImpl$ThemeImpl.finalize(ResourcesImpl.java:1339)
at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:250)
at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:237)
at java.lang.Daemons$Daemon.run(Daemons.java:103)
at java.lang.Thread.run(Thread.java:764)


Probably nothing we can do here?</issue_description>

## Comments on the Issue (you are @copilot in this section)

<comments>
</comments>


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: hussainmohd-a <56958445+hussainmohd-a@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix TimeoutException in ThemeImpl.finalize() Document ThemeImpl.finalize() timeout as known Android framework limitation Nov 17, 2025
Copilot AI requested a review from hussainmohd-a November 17, 2025 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v055u: TimeoutException in ThemeImpl.finalize() timed out after 60 seconds

2 participants