当我使用 proguard 执行混淆时,我收到此错误:
can't find referenced method 'javax.servlet.servletContext getServletContext()' in class javax.servlet.http.httpServletRequest
我尝试包含来自 tomcat7 的 servlet-api,但仍然存在同样的问题。 有什么帮助吗?
最佳答案
忽略错误消息中的小写/大写拼写错误,这只能意味着 ProGuard 在类路径中以某种方式使用 Servlet 2.5 或更早版本。这个方法是introduced在 Servlet 3.0 中。所以具体的问题在于 ProGuard 设置/配置。您需要从 ProGuard 的设置中删除所有 Servlet 2.5 或更早版本的库,并添加一个 Servlet 3.0 兼容库。
关于java - 使用 Proguard 无法在类中找到引用的方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10283581/