Urgent.News

What's breaking now, across thousands of outlets.

Tech

Debugging R8 Release-Only Crashes Without Disabling Optimization

A debug build works. The release build installs. Then one screen crashes only after minification is enabled. The tempting fix is immediate: -keep class com.example.** { *; } Or worse, turn R8 off and ship. Both can make the symptom disappear. Neither tells you what broke. A release-only R8 failure is usually easier to solve when you treat it as an indirect-reference debugging problem , not a…

A release build of an application may crash only after minification is enabled by R8, a code shrinking tool. Applying a simple fix such as -keep class com.example.** { *; } or disabling R8 entirely may hide the issue, but neither provides insight into the underlying problem. To effectively debug release-only R8 failures, treat them as indirect-reference debugging problems rather than attempts to guess ProGuard rules.

The goal is to identify runtime contracts that static analysis cannot see, preserve those contracts, and maintain optimization. Begin by reproducing the failure using the exact release variant that users experience, considering factors like build type, dependency graph, and generated code. Analyze the stack trace provided by R8, which can be preserved in mapping.txt for future reference.

Look for runtime mechanisms that expected the missing class, method, field, or other elements to remain discoverable. Common issues include reflection, runtime class loading, JNI, serialization frameworks, and dynamically discovered implementations. Problems often arise when the program encounters code in ways that static analysis cannot fully infer.

For example, using Class.forName(className) may introduce runtime dependencies that R8 fails to see. Investigate the rules applied by R8, as the configuration can come from various sources, including the application, Android tooling, and dependencies. Use the -whyareyoukeeping diagnostic rule to understand why specific classes are retained.

When writing keep rules, aim for the narrowest scope that expresses the runtime contract, rather than broad rules that keep excessive code. Prefer annotations to make the runtime contract explicit if your code intentionally exposes itself to reflection or discovery. By following these steps, developers can more effectively debug release-only R8 failures and ensure that optimization is applied correctly without disabling it entirely.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

The Automation Gap Is a Finance Workflow Problem, Not a Spreadsheet Problem

Recent fintech research has put a useful number on an old frustration: UK businesses are still losing several days a month to manual finance administration.

  • UK businesses lose days monthly to manual finance administration.
  • Finance workflow complexity, not spreadsheets, is primary problem.
  • Successful automation focuses on workflow, not just replacing tools.

What Mutation Testing Frameworks Do When a Timeout Kills Them

Code: Megapixel99/assay-checks assay audits mutation harnesses: the scripts that deliberately break your code and check that a test notices.

  • Mutation testing frameworks may fail due to timeout signals
  • SIGKILL cannot be caught or handled by frameworks
  • Issue affects mutmut, cosmic-ray, Stryker, and PIT

Oracle PL/SQL Exception Handling

An Exception is a PL/SQL runtime error condition triggered during code execution. When an exception is raised, normal execution of the current PL/SQL block halts immediately, and control transfers to…

  • Exceptions in PL/SQL are runtime errors during code execution.
  • Predefined Oracle server exceptions include NODATAFOUND and TOOMANYROWS.
  • User-defined exceptions are custom business logic violations declared by developers.

The "DevRel Journey" Angle

Hello guy's I am Dilesh Zingare. And this is my first python code and also the first article ever written by me. So yeah I am excited and nervous to but as you know "Beyond fear lies victory." I just…

  • Dilesh Zingare shares debut Python code and first article on DEV Community
  • Introduces "Soul the Restro Waiter" project with bill, menu, and feedback features
  • Beginner Python developer seeks feedback on code and DevRel journey

I Built a Restaurant Website Using Only HTML – My First Frontend Project Series. Part-2

Hello and welcome to my 2nd part of My First Frontend Project Series. I am Dilesh Zingare and, If you didn't read the 1st part of the series believe me you have to read that you are missing something…

  • This is the second part of a series on building a restaurant website using only HTML.
  • The webpage includes clickable buttons and uses HTML structure like headings and div tags.

More from Saturday 19 September →