2

I'm trying to build a large Android project that I was previously running on Android Studio 0.5.2 on 0.8.1. While it builds without errors on 0.5.2, on 0.8.1 the Gradle build fails with some unusual errors, including the following:

 Error:(161) Error: The id "buttonMarkUnread" is not defined anywhere. [UnknownId]
                android:layout_alignBaseline="@+id/buttonMarkUnread"
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Explanation for issues of type "UnknownId": 
The @+id/ syntax refers to an existing id, or creates a new one if it has
not already been defined elsewhere. However, this means that if you have a
typo in your reference, or if the referred view no longer exists, you do
not get a warning since the id will be created on demand. This check
catches errors where you have renamed an id without updating all of the
references to it.

Error: Suspicious method call; should probably call "layout" rather than "onLayout" [WrongCall]

The weird thing is the error messages seem sort of "linty"; that is they seem more like "gotchas" than actual compile errors (that is, they should be warnings). Is there a reason that these are compile errors in the newer versions of AS, and is there a simple fix when it comes to correcting UnknownId, WrongCall, DuplicateIds, and notSibling errors?

Ricky Stewart
  • 1,102
  • 1
  • 8
  • 18

0 Answers0