r/expo • • 1d ago

Why is dex code optimization at 0% in android

 android: {
            enableMinifyInReleaseBuilds: true,
            enableShrinkResourcesInReleaseBuilds: true,


            extraProguardRules: `
              -keep class androidx.work.impl.WorkDatabase_Impl {
                  <init>();
              }
                    `,
          },

I have already done this. My obfuscation percentage and shrinking percentage are both decent, but why aint my optimization optimizing?

1 Upvotes

1 comment sorted by

1

u/zzoa7922 9h ago

Not Expo in my case (a plain Gradle Android app), but I hit something similar. Play reads what R8 wrote into the bundle (r8.json), not your build flags, and right after the upload my optimization ratio just showed "-" for a while even though R8 full mode was on. So I'd open the .aab, check r8.json, and make sure a mapping.txt was generated for that build before touching the proguard rules.