Fixed
Status Update
Comments
ma...@gmail.com <ma...@gmail.com> #2
I had started to work on a CL that (maybe) fixed some of this, but never finished it. I'll take a look.
vi...@google.com <vi...@google.com> #3
Thanks!
Other notes: I think this is technically a regression, because Lint checks are prepared during generateDebugSources
and that used to run during Gradle sync(?)
ma...@gmail.com <ma...@gmail.com> #4
More points to make!
1. I typically was using "make project" because that's what the lint video from ADS shows.https://youtu.be/ffH-LD5uP4s?t=1140
2. In the sample project, If I Right click activity main.xml > analyze > inspect code > Inspection Scope [FILE]
"No lint errors found." This is also weird. You would think that maybe forcefully inspecting the code would create the lint.jar file?
3. In my sample project, running ./gradlew lintDebug makes lint checks work in the IDE again. Amazing! Here is the output for example:
```
coltonidle:CustomLintChecksDoNotWork cidle$ ./gradlew lintDebug
> Task :app:lintDebug FAILED
Wrote HTML report to file:///Users/coltonidle/project/CustomLintChecksDoNotWork/app/build/reports/lint-results-debug.html
Wrote XML report to file:///Users/coltonidle/project/CustomLintChecksDoNotWork/app/build/reports/lint-results-debug.xml
FAILURE: Build failed with an exception.
```
Okay. That makes sense. Failed because of my custom lint error. Now let me try my production project that is a pretty big project, but it's not ridiculously complex. Pretty standard. I do have a few extra modules for a few custom views.
```
> Configure project :app
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
> Task :customView1:lintDebug
Wrote HTML report to file:///Users/coltonidle/project/myapp/customView1/build/reports/lint-results-debug.html
Wrote XML report to file:///Users/coltonidle/project/myapp/customView1/build/reports/lint-results-debug.xml
> Task :customView2:lintDebug
Wrote HTML report to file:///Users/coltonidle/project/myapp/customView2/build/reports/lint-results-debug.html
Wrote XML report to file:///Users/coltonidle/project/myapp/customView2/build/reports/lint-results-debug.xml
> Task :customView3:lintDebug
Wrote HTML report to file:///Users/coltonidle/project/myapp/customView3/build/reports/lint-results-debug.html
Wrote XML report to file:///Users/coltonidle/project/myapp/customView3/build/reports/lint-results-debug.xml
BUILD SUCCESSFUL in 22s
```
Hmmm. That's weird. Successful and not failed (like the sample) and also... where is my :app module outputs?
I see that in all my modules I have
lintOptions {
abortOnError false
}
but in my app module I have
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
so I thought maybe checkReleaseBuilds false, was the cause of some lint issue. But no. When I removed it, it still didn't show. So now I have another problem seemingly where lintDebug won't process my app module
4. Running ./gradlew assemble fails for me because it tries to run a release with signing configs I don't have available. Maybe this is the cause of why lint checks don't work via ./gradlew lintDebug?
Will keep investigating!
1. I typically was using "make project" because that's what the lint video from ADS shows.
2. In the sample project, If I Right click activity main.xml > analyze > inspect code > Inspection Scope [FILE]
"No lint errors found." This is also weird. You would think that maybe forcefully inspecting the code would create the lint.jar file?
3. In my sample project, running ./gradlew lintDebug makes lint checks work in the IDE again. Amazing! Here is the output for example:
```
coltonidle:CustomLintChecksDoNotWork cidle$ ./gradlew lintDebug
> Task :app:lintDebug FAILED
Wrote HTML report to file:///Users/coltonidle/project/CustomLintChecksDoNotWork/app/build/reports/lint-results-debug.html
Wrote XML report to file:///Users/coltonidle/project/CustomLintChecksDoNotWork/app/build/reports/lint-results-debug.xml
FAILURE: Build failed with an exception.
```
Okay. That makes sense. Failed because of my custom lint error. Now let me try my production project that is a pretty big project, but it's not ridiculously complex. Pretty standard. I do have a few extra modules for a few custom views.
```
> Configure project :app
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
> Task :customView1:lintDebug
Wrote HTML report to file:///Users/coltonidle/project/myapp/customView1/build/reports/lint-results-debug.html
Wrote XML report to file:///Users/coltonidle/project/myapp/customView1/build/reports/lint-results-debug.xml
> Task :customView2:lintDebug
Wrote HTML report to file:///Users/coltonidle/project/myapp/customView2/build/reports/lint-results-debug.html
Wrote XML report to file:///Users/coltonidle/project/myapp/customView2/build/reports/lint-results-debug.xml
> Task :customView3:lintDebug
Wrote HTML report to file:///Users/coltonidle/project/myapp/customView3/build/reports/lint-results-debug.html
Wrote XML report to file:///Users/coltonidle/project/myapp/customView3/build/reports/lint-results-debug.xml
BUILD SUCCESSFUL in 22s
```
Hmmm. That's weird. Successful and not failed (like the sample) and also... where is my :app module outputs?
I see that in all my modules I have
lintOptions {
abortOnError false
}
but in my app module I have
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
so I thought maybe checkReleaseBuilds false, was the cause of some lint issue. But no. When I removed it, it still didn't show. So now I have another problem seemingly where lintDebug won't process my app module
4. Running ./gradlew assemble fails for me because it tries to run a release with signing configs I don't have available. Maybe this is the cause of why lint checks don't work via ./gradlew lintDebug?
Will keep investigating!
vi...@google.com <vi...@google.com>
hu...@google.com <hu...@google.com>
hu...@google.com <hu...@google.com> #5
> Other notes: I think this is technically a regression, because Lint checks are prepared during `generateDebugSources` and that used to run during Gradle sync(?)
This most definitely wasn't happening in the past. All of a sudden (couldn't pinpoint which AS of AGP version) it just stopped reporting custom lint checks in the IDE for my entire teams usual workflow. e.g. Write some code and deploy.
Once we noticed that they weren't properly showing then we started to try to force lint to rebuild or remake, but never got it to work. This also reminds me that a few weeks ago we also had an issue where we were making a change to module called customView1 and the changes weren't reflecting. We tried hitting the hammer icon and general clean and stuff, but nothing triggered it. Not sure how we got that module to rebuild, but maybe those things are somehow related as well?
This most definitely wasn't happening in the past. All of a sudden (couldn't pinpoint which AS of AGP version) it just stopped reporting custom lint checks in the IDE for my entire teams usual workflow. e.g. Write some code and deploy.
Once we noticed that they weren't properly showing then we started to try to force lint to rebuild or remake, but never got it to work. This also reminds me that a few weeks ago we also had an issue where we were making a change to module called customView1 and the changes weren't reflecting. We tried hitting the hammer icon and general clean and stuff, but nothing triggered it. Not sure how we got that module to rebuild, but maybe those things are somehow related as well?
Description