Open jonathanpeppers opened 5 years ago
For the behavior mentioned in the proguard-android.txt
header:
Instead, the Android plugin for Gradle generates the default rules at build time and stores them in the build directory.
I suspect that might match the behavior mentioned in https://github.com/xamarin/xamarin-android/issues/3636 about passing the -G
and --proguard
options to AAPT and AAPT2, so I suspect we might want to resolve that issue https://github.com/xamarin/xamarin-android/issues/3636 too as part of resolving this issue https://github.com/xamarin/xamarin-android/issues/3789.
Has there been any updates to this? I have stumbled over this issue after Xamarin wasn't able to find the ProGuard file any more ("ProGuard configuration file [...] was not found").
I have also found that Google seems to recommend using the proguard-android-optimize.txt
file in their docs: https://developer.android.com/studio/build/shrink-code#enable - but maybe these additional "optimizations" could cause problems with Xamarin? This file still seems to be generated at compile time and not be the same version in the SDK folder
The Problem
Context: https://github.com/xamarin/xamarin-android/pull/3787#discussion_r334958805
We use these proguard rules from the Android SDK:
Two questions/issues:
The header says:
Expected Behavior
We should try to match the behavior of the Android Gradle Plugin & Android Studio. User's proguard rules should be able to override what is set by default.
Actual Behavior
Not sure what it is doing currently? Looks like the behavior would be the same for both ProGuard & R8.