I'm transitioning over from Eclipse to Android Studio and I find that I'm still confused about the different components of Android Studio regarding detecting errors. I have a project with about 20 Java files and 30 XML files. I recently ran a clean and build and got
Gradle build finished with 5 error(s) in 13s 397 ms
Two XML files were indicated and in both of them there was whitespace in front of the first element with an error saying ...
Xml declaration should precede all document content
So I fixed those and ran the build again with no errors.
I then ran Lint and found 8 more XML files with errors (NB, errors, not warning) saying "Element selector doesn't have required attribute:layout_height ". This error was apparently due to these files being in a layout folder instead of a drawable folder, although why that didn't cause problems in Eclipse is unclear.
My Questions:
- Why does Gradle Build only detect some errors, but other have to be found via lint?
- What categories of errors will be found via Gradle Build?
- How hard is it to add something to the Gradle Build script to find all errors?
Edit: actually this is also true for regular Java files - I'll get "0 errors" in the Gradle build and then I'll step into a source file in the debugger and see 4 errors from Lint.