Status Update
Comments
ri...@google.com <ri...@google.com> #2
minifyEnabled false
fix the issue, if not, this is not a R8 problem
Also, do you use resource shrinking? (i.e., do you have shrinkResources true)
my...@gmail.com <my...@gmail.com> #3
As you can see in the source code, both of them are enabled. I'll try turning it off and update you.
sg...@google.com <sg...@google.com>
my...@gmail.com <my...@gmail.com> #4
Turning off both minimizing options still yields the same result (renamed res folders). I guess this is not a R8 issue. Could you help me transfer this issue then? :)
ri...@google.com <ri...@google.com> #5
Turning off resource shrinking and r8 still have these files be renamed like:
-rw---- 0.0 fat 1732 b- defN 81-Jan-01 01:01 res/--.xml
-rw---- 0.0 fat 472 b- defN 81-Jan-01 01:01 res/-A.xml
-rw---- 0.0 fat 724 b- defN 81-Jan-01 01:01 res/-A1.xml
-rw---- 0.0 fat 1396 b- defN 81-Jan-01 01:01 res/-Y.xml
-rw---- 0.0 fat 528 b- defN 81-Jan-01 01:01 res/-c.xml
-rw---- 0.0 fat 532 b- defN 81-Jan-01 01:01 res/-o.xml
-rw---- 0.0 fat 1100 b- defN 81-Jan-01 01:01 res/-u.xml
-rw---- 0.0 fat 404 b- stor 81-Jan-01 01:01 res/06.png
-rw---- 0.0 fat 212 b- stor 81-Jan-01 01:01 res/09.9.png
-rw---- 0.0 fat 207 b- stor 81-Jan-01 01:01 res/0H.9.png
ga...@google.com <ga...@google.com> #6
Does adding android.enableResourceOptimizations=false
to gradle.properties
fix the issue for you? AGP started optimizing Android resources for release variants by default in order to reduce APK size.
my...@gmail.com <my...@gmail.com> #7
Indeed that fixes this, even if both minifying options are enabled in gradle files. However, this also seems to turn off other optimizations like converting to webm files.
The main reason I would like to disable renaming is to use APK size analyzer and diff reports. Is there any way to make it so that only renaming is disabled, for example, respecting -dontobfuscate
setting in Proguard configuration somehow?
ga...@google.com <ga...@google.com> #8
We do plan to add more options for configuring Android resource optimizations. Luke, can you please link to the relevant issue?
lu...@google.com <lu...@google.com> #9
Yes, we're planning to add dsl options in the future to provide a way to configure the exact parameters of resource optimisations. There is currently, collapse-resource-names
optimisation parameter, however it seems that after
my...@gmail.com <my...@gmail.com> #10
Thanks! Is there anywhere public where I can track when this new parameter is released?
cx...@qq.com <cx...@qq.com> #11
lu...@google.com <lu...@google.com>
ja...@gmail.com <ja...@gmail.com> #12
lu...@google.com <lu...@google.com> #13
Active development on adding buildTypes options based on the AAPT2 Optimize suboperations has started in the last week. I'll keep you posted when they make it in to an alpha release of AGP.
ja...@gmail.com <ja...@gmail.com> #14
Can I know the option name?
Description
To reproduce, grab this:https://github.com/Mygod/VPNHotspot/commit/c4d44b97509af9fea9c1d38061629f8fedb2c22d
Build apk in Android Studio and put in apk analyzer. Observe that classes.dex are not obfuscated (all classes keep their old names) but things in res folders are renamed.
Downgrading to 4.1.3 from 4.2.0-rc01 fixes this.