Status Update
Comments
el...@google.com <el...@google.com>
yw...@gmail.com <yw...@gmail.com> #2
da...@google.com <da...@google.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
ap...@google.com <ap...@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
.
da...@google.com <da...@google.com>
[Deleted User] <[Deleted User]> #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.
da...@google.com <da...@google.com> #6
Re #5 - please file a new bug with a sample project that reproduces your issue.
ri...@ffw.com <ri...@ffw.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.
da...@google.com <da...@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
na...@google.com <na...@google.com> #9
Re #6: It's essentially
Description
Version used: 2.7.0-alpha08 to latest 2.7.0-alpha10
Devices/Android versions reproduced on: sdk 35
The Room compiler produces this build error:
Execution failed for task ':app:mergeDebugAndroidTestAssets'.
> The value for task ':app:copyRoomSchemasToAndroidTestAssetsDebugAndroidTest' property 'inputDirectory' is final and cannot be changed any further.
Reverting to Room version 2.7.0-alpha07 solves the issue.
I'm attaching a sample project that reproduces the error. Note that the error happens only by cleaning the build folder beforehand; the first full build with the "Make module" button runs "assembleDebug" and "assembleDebug...Test" tasks but from the second build it only runs "assembleDebug", so the build succeeds.