Thursday, November 6, 2014

Android Studio/IntelliJ false error Object.getClass() shows as ambiguous method call

Tired of seeing this issue? Yes, it's terrible because it creates a lot noise for us to find the real errors. And we don't want to bend our code to remove the redness in the IDE with this hack - ((Object)this).getClass(). Solution: Link into the source code by clicking getClass() in your IDE. We should see the code below
    public final Class<?> getClass() {//Remove <?>
      return shadow$_klass_;
    }
Remove the <?> and refresh the project. The red lines should be gone.
    public final Class getClass() {//<?> removed
      return shadow$_klass_;
    }

5 comments:

  1. I simply want to tell you that I’m all new to blogs and truly liked you’re blog site. Very likely I’m likely to bookmark your site . You surely come with remarkable articles. Cheers for sharing your website page.

    Hadoop Training in Chennai

    ReplyDelete
  2. wow really superb you had posted one nice information through this. Definitely it will be useful for many people. So please keep update like this.

    Email Marketing Chennai

    ReplyDelete
  3. Superb. I really enjoyed very much with this article here. Really it is an amazing article I had ever read. I hope it will help a lot for all. Thank you so much for this amazing posts and please keep update like this excellent article.thank you for sharing such a great blog with us. expecting for your.
    Digital Marketing Company in India
    seo Company in India

    ReplyDelete
  4. Learning new technolgy would help oneself at hard part of their career. And staying updated is the only way to survive in current position. Your content tells the same. Thanks for sharing this information in here. Keep blogging like this. ios App Development Company in India

    ReplyDelete
  5. your information is really awesome as well as it is very excellent and i got more interesting information from your blog.
    Security alarm in Chennai

    ReplyDelete