gpt4 book ai didi

java - 迁移到 v28.0.0 支持库后 Android gradle 构建失败

转载 作者:太空狗 更新时间:2023-10-29 14:36:55 24 4
gpt4 key购买 nike

升级到 v28.0.0 Android 支持库(从 27.1.1 开始)后,我的构建失败并出现以下异常:

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'

原因:

Warning: androidx.media.AudioAttributesCompatParcelizer: can't find referenced field 'android.support.v4.media.AudioAttributesImpl mImpl' in program class android.support.v4.media.AudioAttributesCompat
Warning: androidx.media.AudioAttributesImplApi21Parcelizer: can't find referenced field 'android.media.AudioAttributes mAudioAttributes' in program class android.support.v4.media.AudioAttributesImplApi21
Warning: androidx.media.AudioAttributesImplApi21Parcelizer: can't find referenced field 'int mLegacyStreamType' in program class android.support.v4.media.AudioAttributesImplApi21
Warning: androidx.media.AudioAttributesImplBaseParcelizer: can't find referenced field 'int mUsage' in program class android.support.v4.media.AudioAttributesImplBase
Warning: androidx.media.AudioAttributesImplBaseParcelizer: can't find referenced field 'int mContentType' in program class android.support.v4.media.AudioAttributesImplBase
Warning: androidx.media.AudioAttributesImplBaseParcelizer: can't find referenced field 'int mFlags' in program class android.support.v4.media.AudioAttributesImplBase
Warning: androidx.media.AudioAttributesImplBaseParcelizer: can't find referenced field 'int mLegacyStream' in program class android.support.v4.media.AudioAttributesImplBase

我试过添加

-keep class android.support.v4.media.** { *; }

到我的 Gradle 配置,但错误仍然存​​在。

谁能提供任何帮助?

谢谢,

乔希

最佳答案

我不知道这是否是最佳解决方案,但在将这些行添加到我的 proguard-rules.pro 文件后,它解决了问题:

-dontwarn androidx.**
-keep class androidx.** { *; }
-keep interface androidx.** { *; }

关于java - 迁移到 v28.0.0 支持库后 Android gradle 构建失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53946853/

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