【问题标题】:VerifyError on GoogleAuthUtil classGoogleAuthUtil 类上的验证错误
【发布时间】:2015-02-22 15:20:27
【问题描述】:

有时我可以在下面的崩溃报告服务日志中找到

Caused by: java.lang.VerifyError: com/google/android/gms/auth/GoogleAuthUtil
    at com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential.getToken(ProGuard:255)
    at com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential$RequestHandler.intercept(ProGuard:279)
    at com.google.api.client.http.HttpRequest.execute(ProGuard:859)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(ProGuard:410)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(ProGuard:343)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(ProGuard:460)

来自文档

当 VM 注意到尝试加载类时抛出 没有通过类验证阶段。

这种情况很少发生,主要发生在有根设备上。这个类被打包在应用程序中,所以奇怪的是它不仅仅在某些设备上工作。

我认为这是因为有人试图修改应用程序(例如通过 odex 或 dalvik-cache 补丁)。目前我让应用程序崩溃,因为它是LinkageError,在我看来不应该处理。我是对的,还是可能有其他原因导致此问题?

【问题讨论】:

    标签: java android google-authentication verifyerror


    【解决方案1】:

    由于如果遇到错误的字节码,JVM 在类加载过程中会抛出VerifyError,因此任何错误都可能是由检测引起的。您在 Android 上的错误意味着您的字节码包含对 Dalvik 无法加载的 com/google/android/gms/auth/GoogleAuthUtil 的引用。如果 GoogleAuthUtil 中使用的方法需要比设备上现有的 API 级别更高的 API 级别,也会发生这种情况。

    除此之外,很难从客户的设备中推断出更多事实。正如您所建议的那样,可能是有人试图修改应用程序的字节码,或者(如果是根设备更可能)导致 GoogleAuthUtil 无法正常执行的 API。

    考虑到 a) 在大多数情况下,您无法推断出根本原因,并且 b) 即使对此不做太多,让应用程序崩溃也完全没问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-11-10
      • 2014-05-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-02-05
      相关资源
      最近更新 更多