Skip to content

Play Console DEX optimization deadline (Feb 2027) makes R8 support urgent: startup crash with R8 persists on 9.0.4 and 9.1.1 (follow-up to #2039) #2123

Open

Description

This is a follow-up to #2039 (Crash on startup when enabling R8 optimization). I am not reporting a new bug; I am confirming that it still reproduces on runtime 9.1.1 and adding a deadline that makes it urgent.

Why this is now time-sensitive
Google Play Console now flags our app with "DEX code optimization is below our threshold" (Obfuscation 1%, fix by Feb 2027). From Feb 2027, Play requires at least 25% in each of obfuscation, optimization and shrinking for apps with 10 MB or more of uncompressed DEX code, and states that missing it may affect visibility and publishing. Our app has 18.2 MB of DEX, so it is in scope. Any NativeScript app with a similar plugin set is probably in the same position.

Our setup

  • NativeScript Angular app (Angular 20.2, @nativescript/angular 20.x)
  • Android runtime 9.0.4, and again after upgrading to 9.1.1
  • Plugins with native code: Firebase messaging, Google Maps, Google Sign-In, ML Kit (barcode + text recognition), geolocation, secure storage, local notifications
  • Release build with minifyEnabled true, shrinkResources true, proguard-android-optimize.txt and broad manual keep rules (androidx., com.google., com.tns.**, our app package)

Result
Same crash on both 9.0.4 and 9.1.1 at startup:

JNI DETECTED ERROR IN APPLICATION: java_class == null
from void com.tns.Runtime.runModule(int, java.lang.String)

followed by "Module evaluation promise rejected: .../bundle.mjs". The stack frames show r8-map-id, so R8 was active. The log does not name the missing class, so we cannot tell which keep rule is missing.

Questions

  1. Is the metadata-driven keep rule generation proposed here (and the bundle-analysis approach in Unified Apple and Android runtime: shared engine layer, direct engine bindings, React Native runtimes#43) planned for a release, and is there a rough timeline?
  2. Is there a supported interim way to enable R8 that reaches 25% in all three categories, or to get below the 10 MB DEX threshold?
  3. Could the runtime log the class name when FindClass returns null instead of passing it to JNI? That alone would make manual rules debuggable.

Happy to test a pre-release runtime or a patch against our app and report results.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions