Status Update
Comments
vi...@google.com <vi...@google.com> #2
bh...@gmail.com <bh...@gmail.com> #3
Branch: androidx-master-dev
commit 41c9e54ce4ab51f95d19a55fa92a56b6bd018c62
Author: Ian Lake <ilake@google.com>
Date: Mon Mar 23 16:07:32 2020
Allow obfuscation of kept Fragments
Fragments that are kept solely by class
can safely be obfuscated.
By switching to keepclasseswithmembers,
only classes with a default constructor
will qualify to be kept. This also allows
shrinking of classes that are constructed
through a custom FragmentFactory.
Test: tested in sample app at
BUG: 151605338
Change-Id: I68ea8779bce80f33f27658cf87a94ccede5376b0
M fragment/fragment/proguard-rules.pro
vi...@google.com <vi...@google.com> #4
While -keepclassmembers
caused a regression in the allowsObfuscation
to allow even kept fragments to be obfuscated.
This will be available in the upcoming Fragment 1.2.4
and 1.3.0-alpha03
.
bh...@gmail.com <bh...@gmail.com> #5
The new release 1.2.4 now leads to a direct crash on app-start, i.e. when Android tries to inflate any Fragment referenced in the main navigation graph.
vi...@google.com <vi...@google.com> #6
Re #5 - please file a new bug with a sample project that reproduces your issue.
bh...@gmail.com <bh...@gmail.com> #7
This change in 1.2.4 also leads to ClassNotFoundException when a fragment is created by providing a name attribute to a FragmentContainerView if the referenced fragment class name is not explicitly kept and obfuscation is enabled:
<androidx.fragment.app.FragmentContainerView
...
android:name="fullClassName"
... />
This, of course, is the expected behavior, but I think it is too much of an API-breaking change for a patch release.
vi...@google.com <vi...@google.com> #8
Re #7 - please make sure you've followed the instructions in FragmentContainerView
referenced classes as per the
If you're using Android Gradle Plugin 4.1 Canary 4 or higher and you're not getting your classes properly kept and non-obfuscated when using FragmentContainerView
, please
vi...@google.com <vi...@google.com>
vi...@google.com <vi...@google.com> #9
Re #6: It's essentially
Description