24

I run ./gradlew clean lint command in console and get Lint report in build/lint/ReleaseOutput.html and build/lint/ReleaseOutput.xml I got 6 times the same error: enter image description here And I also see 6 times the same times one issue in XML file:

<issue
   id="UselessParent"
   severity="Error"
    ...
</issue>

So, why it has happened and how to avoid such problem? Because one issue multiply 6 and displayed incorectly in Jenkins statistics.

UPDATE:

I found that this bug related to gradle lint task. To get lint metrix Gradle build few times:

file="build/manifests/release/AndroidManifest.xml"
file="build/manifests/debug/AndroidManifest.xml"

So it also can double total number of issues.

donfuxx
  • 11,277
  • 6
  • 44
  • 76
Borys
  • 1,793
  • 2
  • 17
  • 32

5 Answers5

1

Also you can run ./gradlew clean lintDebug so lint only analyze the debug build, in that way you increase the speed and you get only the warning for that build. Also you have to had in mind that if you use flavors the warnings could be reported by build type and also by flavor.

jamesbluecrow
  • 134
  • 1
  • 5
0

That message is just a warning, your application will still compile fine. It means that a either the children of your root element do not contain any children, or that the way you are organizing your layout can be more effectively done by using a flatter layout hierarchy. Ex. using one master FrameLayout, RelativeLayout, or LinearLayout instead of nesting layouts inside of each other.

gollum18
  • 182
  • 1
  • 8
0

Its just warning. Still follow below steps...

In Window > Preferences > Android > Lint Error Checking, uncheck "When saving files check for errors".

Enjoy

Ganesh Katikar
  • 2,620
  • 1
  • 26
  • 28
0

The most obvious fix is to remove either the FrameLayout or its LinearLayout parent from your layout. This will fix the problem which lint is warning about.

Code-Apprentice
  • 81,660
  • 23
  • 145
  • 268
-1

I had the same problem, and I found I could solve it by right clicking on the project folder, then selecting "Android tools" -> "Clear Link Markers".

womble
  • 12,033
  • 5
  • 52
  • 66