Google Play Console DEX Code Optimization Warning in Mendix 10.24.6

0
Hi Team,We have developed and deployed a native mobile application using Mendix Studio Pro 10.24.6, and the application is currently available on the Google Play Store.Recently, we received a warning in Google Play Console regarding DEX code optimization.Warning details:Issue: DEX code optimization is below our thresholdCategory: Obfuscation (1%)Google Play Console indicates that percentages below 25% in any category may affect app visibility and publishing capabilities.I would like to understand how to resolve this issue.Questions:Has anyone encountered this DEX code optimization warning in a Mendix native mobile application?Is the 1% obfuscation score related to the Mendix Native Template or the Android build configuration?Does Mendix 10.24.6 support the required DEX code obfuscation, shrinking, and optimization?Is there a recommended Native Template or Native Mobile Builder version that addresses this issue?Can this be resolved through supported build configuration changes, or is upgrading to a newer Mendix version necessary?Has anyone successfully resolved this warning and verified the updated scores in Google Play Console?I would appreciate any guidance, recommended solutions, or experience from community members who have faced a similar issue.Thank you!
asked
2 answers
0

Hi Krushna,


This warning is related to Android DEX code optimization, specifically the 1% obfuscation score reported by Google Play Console. It is not necessarily an application defect, but it should be addressed before Google's enforcement deadline.


1. Is this a known issue with Mendix Native Mobile?


The warning is generated by Google Play's analysis of the uploaded Android App Bundle (AAB). I could not confirm from the official Mendix release notes that this is a known defect specific to Mendix 10.24.6.

Google's requirement applies to Android applications regardless of the framework used to build them.


2. Is the 1% obfuscation score related to the Native Template?


It could be related to the Android build configuration used by the Native Template, but the score alone does not prove that.

Obfuscation depends on how the Android build processes compiled Java/Kotlin code and its dependencies. If the release build does not apply sufficient obfuscation, the resulting score can be low.


3. Does Mendix 10.24.6 support the required optimization?


Mendix 10.24.6 supports building native Android applications, but the Studio Pro version alone does not establish whether the generated AAB meets Google's new DEX optimization thresholds.

Google recommends tools such as R8 to shrink, optimize, and obfuscate Android code. The actual result must be verified in the generated AAB and Google Play Console.


4. Which version should be used?


I recommend using the latest supported Mendix 10.24 patch and the corresponding compatible Native Template, together with the latest suitable Native Mobile Builder.

However, do not assume that upgrading alone resolves the warning. The relevant Mendix release notes should be checked for an explicit fix or improvement to Android code shrinking and obfuscation.


5. Can this be fixed through build configuration?


First, inspect the generated Android project and confirm whether release builds enable R8 or another supported optimizer.

If you control the Native Template and build pipeline, work with the Android build configuration to enable the appropriate release optimizations. Review required keep rules carefully, because removing or renaming classes used through reflection or native dependencies can break functionality.

If you are using the standard Mendix Native Mobile Builder without access to these settings, contact Mendix Support to confirm whether your specific version supports configuring R8 or whether an updated template is required. Avoid modifying generated build files unless the customization is supported and can be maintained across upgrades.


6. How can you verify the fix?


  1. Generate a new signed release AAB using the updated build configuration.
  2. Upload it to a Google Play testing track.
  3. Open the uploaded bundle in Play Console's App Bundle Explorer and review the DEX optimization metrics.
  4. Confirm that the applicable obfuscation, optimization, and shrinking scores meet Google's thresholds.
  5. Test login, navigation, native plugins, push notifications, and other critical functionality before releasing to production.

Google's published requirements specify a minimum of 25% for each applicable category beginning in February 2027, for apps containing more than 10 MB of DEX code.


Official references:


My recommendation is to inspect the generated AAB and confirm the Android release-build configuration first. If the standard Mendix build does not expose the necessary optimization settings, raise a support request with Mendix and include the Play Console warning and the build/template versions. This will help establish the supported fix for your exact setup.


Hope this helps! If you find this answer helpful, please mark it as the accepted answer.

answered
0

Hi Krushna,

I checked the Mendix Native Template source code, and the cause is clear: R8 (Android’s code shrinker and obfuscator) is turned off by default in the Native Template. In android/app/build.gradle:


def enableProguardInReleaseBuilds = false

minifyEnabled enableProguardInReleaseBuilds


With R8 off, the release build isn’t obfuscated, optimized or shrunk, which is exactly why Google Play reports 1% obfuscation.

To your questions

  • Is it related to the Native Template or the build configuration? Yes, it’s the template’s Android build configuration, not your app or Mendix 10.24.6 itself.
  • Will upgrading Mendix or the template fix it? No. The setting is false in v14.1.21 (the latest Native Template for Mendix 10.24) and still false in the newest template, v20.0.1 for Mendix 11. So you need to change it yourself.
  • Is it supported? Yes. It’s a standard Android/React Native setting, and the template already has it wired up. It just needs to be switched on.

How to fix it

In your app’s native template project (the repository or local folder the Native Mobile Builder uses for your app):

Step 1: In android/app/build.gradle, turn R8 on:

def enableProguardInReleaseBuilds = true


Step 2: In the release block of the same file, use the optimize version of the default rules file:

proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"


The older proguard-android.txt turns optimization off, and optimization is one of the three categories Google measures.

Step 3: Add keep rules to android/app/proguard-rules.pro for libraries R8 could otherwise break. The newest Native Template already includes these, so you can copy them if your app uses biometrics or images:


-keep class androidx.biometric.** { *; }

-keep class com.sbaiahmed1.reactnativebiometrics.** { *; }

-keep public class com.dylanvann.fastimage.* {*;}

-keep public class com.dylanvann.fastimage.** {*;}

-keep public class * implements com.bumptech.glide.module.GlideModule

-keep public class * extends com.bumptech.glide.module.AppGlideModule


Step 4: Build a new release AAB and upload it to an internal testing track first.

Test carefully before releasing

R8 removes and renames code it thinks is unused, and some native modules use reflection, so a missing keep rule can cause a crash that only happens in release builds. Test login, navigation, offline sync, push notifications, camera, biometrics and any other native features. If something crashes, the Android log (adb logcat) usually shows a ClassNotFoundException naming the class, and you add a -keep rule for that package.

Checking the result

After uploading, check the obfuscation, optimization and shrinking scores in Play Console. Your warning mentions a minimum of 25% per category.

Google only raises this alert for apps with at least 10 MB of DEX code. You can check your bundle’s DEX size with:

unzip -l yourapp.aab | grep -E '\.dex$' | awk '{sum+=$1} END {print sum}'

References

If this helps, please mark it as the accepted answer.

answered