gpt4 book ai didi

android - Pro guard错误构建发布apk

转载 作者:可可西里 更新时间:2023-11-01 19:05:55 26 4
gpt4 key购买 nike

我在尝试构建发布 apk 时遇到以下错误

:app:compileReleaseNdk UP-TO-DATE
:app:compileReleaseSources
:app:lintVitalRelease
:app:proguardRelease
Warning: android.support.v4.app.NotificationCompat$NotificationCompatImplBase: 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: android.support.v4.app.NotificationCompat$NotificationCompatImplGingerbread: 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: android.support.v4.app.NotificationCompatGingerbread: 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 3 unresolved references to library class members.
You probably need to update the library versions.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedlibraryclassmember)
:app:proguardRelease FAILED

在 build.gradle 中我有这个:

依赖关系{ 编译“com.android.support:support-v4:23.0.0”

如果我将其更改为 "com.android.support:support-v13:23.0.0"

仍然会出现相同的错误

当错误消息这样说时:“您可能需要更新库版本。”它指的是什么库,我该如何更新它?

错误中引用的文档说: “如果您正在为 Android 开发并且 ProGuard 提示它无法找到仅在最新版本的 Android 运行时中可用的方法,您应该更改 project.properties 文件中的构建目标或build.gradle 文件到最新版本。您仍然可以在 AndroidManifest.xml 文件中指定不同的 minSdkVersion 和不同的 targetSdkVersion。“

这是我的 build.gradle,它的 API 23 是最新的。那么我该如何解决这个问题呢?

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"

defaultConfig {
applicationId "com.cequint.ecid"
minSdkVersion 23
compileSdkVersion 23
}

最佳答案

我将它添加到 pro guard.cfg 并且它起作用了:

-dontwarn android.support.v4.**

关于android - Pro guard错误构建发布apk,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33176876/

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