You should build against API level 11 that contains the missing class. The library itself probably has a fallback mode for older APIs, but ProGuard still needs to process the entire application, including the newer code.
Proguard fails with Google Play Services library
-
22-07-2023 - |
Question
I'm unable to build my package with Proguard
enabled after updating Google Play Services
library. My project minSdkVersion
is 9. I am using following version of services lib:
android:versionCode="4323030"
android:versionName="4.3.23 (1069729-030)" >
The library states minSdk
also 9.
And getting error:
Unexpected error while performing partial evaluation:
Class = [com/google/android/gms/common/GooglePlayServicesUtil]
Method = [showErrorDialogFragment(ILandroid/app/Activity;ILandroid/content/DialogInterface$OnCancelListener;)Z]
Exception = [java.lang.IllegalArgumentException] (Can't find any super classes of [com/google/android/gms/common/ErrorDialogFragment] (not even immediate super class [android/app/DialogFragment]))
java.lang.IllegalArgumentException: Can't find any super classes of [com/google/android/gms/common/ErrorDialogFragment] (not even immediate super class [android/app/DialogFragment])
Following related to gms is found in my proguard file:
-dontwarn com.google.android.gms.**
-keep class com.google.android.gms.** { *; }
-keep class * extends java.util.ListResourceBundle {
protected Object[][] getContents();
}
-keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {
public static final *** NULL;
}
-keepnames @com.google.android.gms.common.annotation.KeepName class *
-keepclassmembernames class * {
@com.google.android.gms.common.annotation.KeepName *;
}
-keepnames class * implements android.os.Parcelable {
public static final ** CREATOR;
}
DialogFragment
was added in API level 11. Is this a failure with the services library or am I missing something?
Thanks.
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow