You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.
8.2.0.15 (HEAD/22d97e153)
Visual Studio 2017 Professional (15.6.2)
Operating System & Version (eg: Mac OSX 10.11):
Windows 10 Professional 1709
Support Libraries Version (eg: 23.3.0):
27.0.2
Describe your Issue:
Since updating to version 27.0.2 of the support library packages there seems to be some issues with Proguard stripping required classes of the support library when its enabled. This causes several ClassNotFoundException or InflaterException at runtime.
In version 26.1.0.1 of the packages it seems the recommended proguard rules are contained within the package and are automatically applied. For 27.0.2 it seems these automatically added proguard rules are missing or incomplete.
A temporary workaround I'm currently using is to add a custom proguard config file to the project:
-dontwarn com.google.android.gms.**
-keep class com.google.android.gms.** { *; }
-keep class com.google.firebase.** { *; }
-keep public class android.support.v7.widget.** { *; }
-keep public class android.support.v7.internal.widget.** { *; }
-keep public class android.support.v7.internal.view.menu.** { *; }
-keep public class * extends android.support.v4.view.ActionProvider {
public <init>(android.content.Context);
}
Include any relevant Exception Stack traces, build logs, adb logs:
Examples of exception messages:
Caused by: android.view.InflateException: Binary XML file line #1: Binary XML file line #1: Error inflating class android.support.percent.PercentRelativeLayout
Caused by: android.view.InflateException: Binary XML file line #20: Error inflating class android.support.v7.widget.FitWindowsFrameLayout
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.widget.FitWindowsFrameLayout" on path: DexPathList[[zip file "/data/app/com.myapp.MySupportTestApp-A3fhhoeYX14MQWpus4nyMA==/base.apk"],nativeLibraryDirectories=[/data/app/com.myapp.MySupportTestApp-A3fhhoeYX14MQWpus4nyMA==/lib/arm, /data/app/ccom.myapp.MySupportTestApp-A3fhhoeYX14MQWpus4nyMA==/base.apk!/lib/armeabi-v7a, /system/lib, /system/vendor/lib]]
java.lang.RuntimeException: Unable to instantiate receiver com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver" on path: DexPathList[[zip file "/data/app/com.myapp.MySupportTestApp-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.myapp.MySupportTestApp-1, /vendor/lib, /system/lib]]
The text was updated successfully, but these errors were encountered:
leonluc-dev
changed the title
Proguard issues with version 27.0.2
Proguard issues with version 27.0.2 of support library packages
Mar 20, 2018
-keep public class android.support.** { *; } - is too broad. -keep public class android.support.v7.widget.** { *; } - is more specific and should be enough :)
By some reasons, not for me (too many warnings from proguard and as result it's not build), but you are right, it's to broad and now I stayed on adding to answer of @gameleon-dev this rule: -dontwarn android.support.**
it's enough :)
Also, I cleared my message above, that no one would use this bad answer
Xamarin.Android Version (eg: 6.0):
8.2.0.15 (HEAD/22d97e153)
Visual Studio 2017 Professional (15.6.2)
Operating System & Version (eg: Mac OSX 10.11):
Windows 10 Professional 1709
Support Libraries Version (eg: 23.3.0):
27.0.2
Describe your Issue:
Since updating to version 27.0.2 of the support library packages there seems to be some issues with Proguard stripping required classes of the support library when its enabled. This causes several
ClassNotFoundException
orInflaterException
at runtime.In version 26.1.0.1 of the packages it seems the recommended proguard rules are contained within the package and are automatically applied. For 27.0.2 it seems these automatically added proguard rules are missing or incomplete.
A temporary workaround I'm currently using is to add a custom proguard config file to the project:
Include any relevant Exception Stack traces, build logs, adb logs:
Examples of exception messages:
Caused by: android.view.InflateException: Binary XML file line #1: Binary XML file line #1: Error inflating class android.support.percent.PercentRelativeLayout
java.lang.RuntimeException: Unable to instantiate receiver com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver" on path: DexPathList[[zip file "/data/app/com.myapp.MySupportTestApp-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.myapp.MySupportTestApp-1, /vendor/lib, /system/lib]]
The text was updated successfully, but these errors were encountered: