【转】can't find referenced method 'android.app.RemoteInput[] getRemoteInputs()' in class android.app.Notification$Action

原文网址:http://*.com/questions/25508735/cant-find-referenced-method-android-app-remoteinput-getremoteinputs-in-cl

I am kind of stuck from past 1 week from this issue. I am trying to export my android app for final release but it gives following errror while exporting.

Proguard returned with error code 1. See console
[2014-08-26 19:55:11 - ] Note: there were 1281 duplicate class definitions.
[2014-08-26 19:55:11 - ] Warning: android.support.v4.app.NotificationCompatApi20: can't find referenced method 'android.app.RemoteInput[] getRemoteInputs()' in class android.app.Notification$Action
[2014-08-26 19:55:11 - ] Warning: android.support.v4.app.NotificationCompatApi20: can't find referenced method 'android.os.Bundle getExtras()' in class android.app.Notification$Action
[2014-08-26 19:55:11 - ] Warning: android.support.v4.app.NotificationCompatApi20: can't find referenced class android.app.Notification$Action$Builder
[2014-08-26 19:55:11 - ] Warning: android.support.v4.app.NotificationCompatApi20: can't find referenced class android.app.Notification$Action$Builder
[2014-08-26 19:55:11 - ] Warning: android.support.v4.app.NotificationCompatApi20: can't find referenced class android.app.Notification$Action$Builder
[2014-08-26 19:55:11 - ] Warning: android.support.v4.app.NotificationCompatApi20: can't find referenced class android.app.Notification$Action$Builder
[2014-08-26 19:55:11 - ] Warning: android.support.v4.app.NotificationCompatApi20: can't find referenced class android.app.Notification$Action$Builder
[2014-08-26 19:55:11 - ] Warning: android.support.v4.app.NotificationCompatApi20: can't find referenced method 'java.lang.String getGroup()' in class android.app.Notification
[2014-08-26 19:55:11 - ] Warning: android.support.v4.app.NotificationCompatApi20: can't find referenced method 'java.lang.String getSortKey()' in class android.app.Notification

I am using below entries in my proguard-project.txt file.

-keepclassmembers class fqcn.of.javascript.interface.for.webview {
public *;
}
-keepattributes Signature,RuntimeVisibleAnnotations,AnnotationDefault -keepclassmembers class * {
@com.google.api.client.util.Key <fields>;
}
-keep class android.support.v4.** { *; }
-dontwarn **CompatHoneycomb
-dontwarn javax.jdo.**
-dontwarn com.google.api.client.extensions.android.**
-dontwarn com.google.api.client.googleapis.extensions.android.gms.** # Needed by google-api-client-android when linking against an older platform version -dontwarn com.google.api.client.googleapis.extensions.android.** -injars lib/android-support-v4.jar
-injars lib/gcm.jar
-injars lib/google-api-client-1.18.0-rc.jar
-injars lib/google-api-client-android-1.18.0-rc.jar
-injars lib/google-http-client-1.18.0-rc.jar
-injars lib/google-http-client-android-1.18.0-rc.jar
-injars lib/google-http-client-gson-1.18.0-rc.jar
-injars lib/google-http-client-jackson2-1.18.0-rc.jar
-injars lib/google-http-client-jdo-1.18.0-rc.jar
-injars lib/google-oauth-client-1.18.0-rc.jar
-injars lib/gson-2.1.jar
-injars lib/jackson-core-2.1.3.jar
-injars lib/jsr305-1.3.9.jar # Needed by google-play-services when linking against an older platform version -dontwarn com.google.android.gms.**

I am able to export my .apk file successfully from eclipse if I am using below content in my proguard-project.txt file. BUT when I am installing and running that app in device , it is crashing.

-keep class android.support.v4.** { *; }
-dontwarn android.support.v4.**
-dontwarn javax.activation.**
-dontwarn javax.security.**
-dontwarn java.awt.**
-libraryjars <java.home>/lib/rt.jar
-keep class javax.** {*;}
-keep class com.sun.** {*;}
-keep class myjava.** {*;}
-keep class org.apache.harmony.** {*;}
-keep public class Mail {*;}
-dontshrink
-dontwarn org.mockito.**
-dontwarn sun.reflect.**
-dontwarn android.test.**
-keep class javax.ws.rs.** { *; }
-dontwarn com.fasterxml.jackson.**
-dontwarn org.xmlpull.v1.**
-dontwarn javax.jdo.**
-dontwarn com.google.api.client.googleapis.extensions.android.gms.**

Please help me How to fix this. can't I directly export .apk file without using proguard configuration?. Thanks. please let me know if i have to provide more information.

 

perhaps some support v4 class or interface was confounded, i tried this and it works

-dontwarn android.support.v4.**
-keep class android.support.v4.** { *; }
-keep interface android.support.v4.app.** { *; }
-keep public class * extends android.support.v4.**
-keep public class * extends android.app.Fragment
上一篇:关于sleep函数的一些问题和资料


下一篇:SQL特殊字符转义