您如何解释"java.lang.NoSuchMethodError:没有直接方法"? [英] How do you interpret "java.lang.NoSuchMethodError: No direct method"?

查看:330
本文介绍了您如何解释"java.lang.NoSuchMethodError:没有直接方法"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们天真地决定,我们应该将许多库从两年的1.12.0-betas更新到不错的新版本1.20.0.例如:我们将google-http-client-1.12.0-beta.jar更新为google-http-client-android-1.20.0.jar.

We decided, perhaps naively, that we should update many of our libraries from two-year-old 1.12.0-betas to nice new versions 1.20.0. For example: we updated google-http-client-1.12.0-beta.jar to google-http-client-android-1.20.0.jar.

当我们执行此代码时:

  List<String> scopes = Lists.newArrayList(SendToGoogleUtils.FUSION_TABLES_SCOPE);
  GoogleAccountCredential credential = SendToGoogleUtils.getGoogleAccountCredential(
      context, account.name, scopes );
  if (credential == null) {
    return false;
  }
  Fusiontables fusiontables = new Fusiontables.Builder(
      AndroidHttp.newCompatibleTransport(), new GsonFactory(), credential).build();

我们得到了这个惊人的错误报告:

we get this amazing error report:

FATAL EXCEPTION Caused by: java.lang.NoSuchMethodError: No direct method <init>(Lcom/google/api/client/http/HttpTransport;Lcom/google/api/client/http/HttpRequestInitializer;Ljava/lang/String;Ljava/lang/String;Lcom/google/api/client/json/JsonObjectParser;Lcom/google/api/client/googleapis/services/GoogleClientRequestInitializer;Ljava/lang/String;Z)V in class Lcom/google/api/client/googleapis/services/json/AbstractGoogleJsonClient; or its super classes (declaration of 'com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient' appears in /data/app/dkr.ajijic.apps.tm-1/base.apk)

有人知道如何解释它吗?我们肯定不会!

Does anybody know how to interpret it? We sure don't!

推荐答案

这只是意味着没有带有特定参数列表的AbstractGoogleJsonClient的构造函数.

It just means that a constructor for AbstractGoogleJsonClient with a particular argument list wasn't available.

检查您的 super()调用是否为 AbstractGoogleJsonClient 的子类,并确保不需要更新参数列表以匹配更新的库.

Check your super() calls for your subclass(es) of AbstractGoogleJsonClient and make sure you don't need to update the argument list to match your updated libraries.

如果您的源代码中没有此内容,则Google API客户端库可能存在库版本依赖性问题.

If that's not in your source code, then there may be a library version dependency issue with Google API client library.

这篇关于您如何解释"java.lang.NoSuchMethodError:没有直接方法"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆