gpt4 book ai didi

java - 在类 android.app.Notification$Action 中找不到引用的方法 'android.app.RemoteInput[] getRemoteInputs()'

转载 作者:行者123 更新时间:2023-11-29 05:19:03 25 4
gpt4 key购买 nike

过去 1 周以来,我一直被这个问题困扰。我正在尝试导出我的 Android 应用程序以进行最终发布,但在导出时出现以下错误。

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

我在我的 proguard-project.txt 文件中使用以下条目。

-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.**

如果我在我的 proguard-project.txt 文件中使用以下内容,我可以从 eclipse 成功导出我的 .apk 文件。但是,当我在设备中安装并运行该应用程序时,它崩溃了。

-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.**

请帮我解决这个问题。我不能不使用 proguard 配置直接导出 .apk 文件吗?。谢谢。如果我必须提供更多信息,请告诉我。

最佳答案

也许一些支持 v4 的类或接口(interface)被混淆了,我试过了并且它有效

-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

关于java - 在类 android.app.Notification$Action 中找不到引用的方法 'android.app.RemoteInput[] getRemoteInputs()',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25508735/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com