java.lang.AbstractMethodError:抽象方法

时间:2016-05-31 23:55:49

标签: java android google-play-services

我正在尝试在Google Play中保存游戏功能的示例 - 收集所有星星2 - 在此处找到:https://github.com/playgameservices/android-basic-samples

它工作正常,但一旦我启用proguard,我得到以下错误:

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)

我已尝试修改proguard-project文件,但仍然存在错误。

我当前的proguard-project文件:

# 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

0 个答案:

没有答案