百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
返回工具页/返回 Issues 列表
#4134·retrofit

R8 中未使用的 Retrofit 服务抛出了 ClassCastException

作者: grandstaish创建于 2024年4月30日更新于 2026年7月16日

这里有一个边缘情况,但如果 Retrofit 接口中的所有函数都未使用,R8 将删除它们。这会导致以下 Proguard 规则无法匹配:https://GitHub.com/square/retrofit/blob/dfdad425e9d1c47dbce335c9808c75c72ef912cc/retrofit/src/main/resources/META-INF/proguard/retrofit2.pro#L31

内容来源: lysine-dev/retrofit

查看 GitHub 原文在 GitHub 查看讨论