3

I'm trying to implement the example for saved game features in google play - Collect All The Stars 2 - found here: https://github.com/playgameservices/android-basic-samples.

It works fine but as soon as I enable proguard I get the below error:

06-01 00:42:01.711: E/AndroidRuntime(24227): FATAL EXCEPTION: main
06-01 00:42:01.711: E/AndroidRuntime(24227): Process: com.package.catt, PID: 24227
06-01 00:42:01.711: E/AndroidRuntime(24227): java.lang.AbstractMethodError: abstract method "void android.view.View$OnAttachStateChangeListener.onViewAttachedToWindow(android.view.View)"
06-01 00:42:01.711: E/AndroidRuntime(24227):    at android.view.View.dispatchAttachedToWindow(View.java:15816)
06-01 00:42:01.711: E/AndroidRuntime(24227):    at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3137)
06-01 00:42:01.711: E/AndroidRuntime(24227):    at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3145)
06-01 00:42:01.711: E/AndroidRuntime(24227):    at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3145)
06-01 00:42:01.711: E/AndroidRuntime(24227):    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1731)
06-01 00:42:01.711: E/AndroidRuntime(24227):    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1437)
06-01 00:42:01.711: E/AndroidRuntime(24227):    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7397)
06-01 00:42:01.711: E/AndroidRuntime(24227):    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:920)
06-01 00:42:01.711: E/AndroidRuntime(24227):    at android.view.Choreographer.doCallbacks(Choreographer.java:695)
06-01 00:42:01.711: E/AndroidRuntime(24227):    at android.view.Choreographer.doFrame(Choreographer.java:631)
06-01 00:42:01.711: E/AndroidRuntime(24227):    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:906)
06-01 00:42:01.711: E/AndroidRuntime(24227):    at android.os.Handler.handleCallback(Handler.java:739)
06-01 00:42:01.711: E/AndroidRuntime(24227):    at android.os.Handler.dispatchMessage(Handler.java:95)
06-01 00:42:01.711: E/AndroidRuntime(24227):    at android.os.Looper.loop(Looper.java:158)
06-01 00:42:01.711: E/AndroidRuntime(24227):    at android.app.ActivityThread.main(ActivityThread.java:7224)
06-01 00:42:01.711: E/AndroidRuntime(24227):    at java.lang.reflect.Method.invoke(Native Method)
06-01 00:42:01.711: E/AndroidRuntime(24227):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
06-01 00:42:01.711: E/AndroidRuntime(24227):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

I've tried amending the proguard-project file but it still errors.

My current proguard-project file:

# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}
-keep class com.android.vending.billing.**
-dontwarn com.google.**
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable

-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 class * implements android.os.Parcelable
-keepclassmembers class * implements android.os.Parcelable {
public static final *** CREATOR;
}

-keep @interface android.support.annotation.Keep
-keep @android.support.annotation.Keep class *
-keepclasseswithmembers class * {
@android.support.annotation.Keep <fields>;
}
-keepclasseswithmembers class * {
@android.support.annotation.Keep <methods>;
}

-keep @interface com.google.android.gms.common.annotation.KeepName
-keepnames @com.google.android.gms.common.annotation.KeepName class *
-keepclassmembernames class * {
@com.google.android.gms.common.annotation.KeepName *;
}

-keep @interface com.google.android.gms.common.util.DynamiteApi
-keep public @com.google.android.gms.common.util.DynamiteApi class * {
public <fields>;
public <methods>;
}

-dontwarn android.security.NetworkSecurityPolicy
1
  • Has anyone managed to get the sample project to work with proguard enabled? Jun 21, 2016 at 22:24

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.