生成singed apk错误

时间:2016-04-16 21:36:57

标签: android gradle apk proguard android-proguard

不生成烧焦的apk。但在运行app时没有错误。

在我们的应用程序上运行ProGuard并生成apk时,我们会看到以下警告。

Warning:com.localytics.android.SessionHandler$15: can't find referenced method 'void setLatestEventInfo(android.content.Context,java.lang.CharSequence,java.lang.CharSequence,android.app.PendingIntent)' in library class android.app.Notification
Warning:there were 1 unresolved references to library class members.
     You probably need to update the library versions.
     (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedlibraryclassmember)
Warning:Exception while processing task java.io.IOException: Please correct the above warnings first.
:app:transformClassesAndResourcesWithProguardForRelease FAILED
Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
java.io.IOException: Please correct the above warnings first.

2 个答案:

答案 0 :(得分:0)

The problem显然是setLatestEventInfo and a quick search表明这是错误/弃用问题的结果。查看链接或搜索“setLatestEventInfo”

答案 1 :(得分:0)

您可能设置了minifyEnabled = true,如果是这样的话......请在proguard( proguard-rules.pro 文件)中设置下面提到的行。

  -dontwarn android.app.Notification