lint baseline fails on subsequent run

Skip to first unread message

Kiki Chang

Apr 7, 2022, 11:09:32 AM4/7/22
to lint-dev
Recently upgraded project to Gradle 7.2 / AGP 7.1.2 from 4.x. 

When creating new baselines for each modules, I first remove all existing baselines in each module, followed by running `./gradlew lintDebug -Dlint.baselines.continue=true` to get all new baselines. Without changing any code, running `./gradlew lintDebug` again always fails on one of the modules' (moduleX) lintDebug task. Looking at that module's generated lint-baseline, I saw that the failed issues were already in baseline, but their <location> has a new line `message="Occurrence in layout"` that looks something like this  

<issues format="6" by="lint 7.1.2" type="baseline" client="gradle" dependencies="false" name="AGP (7.1.2)" variant="all" version="7.1.2"> 
       message="The id someId in layout someLayout is missing from the following layout configurations: layout-sw720dp-land (present in layout)" 
      errorLine1=" android:id=someId" 
      errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> 
           message="Occurrence in layout"/> 

Removing the lines with `message="Occurrence in layout"` would fix the issue. I am wondering if this message line shouldn't be under location and if so why it gets generated in the first place.


Reply all
Reply to author
0 new messages