Status Update
Comments
uc...@google.com <uc...@google.com>
da...@google.com <da...@google.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.
da...@google.com <da...@google.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!
Description
Repro
Expected: No issues. Actual: It reports that activity_main.xml is unused (even though it's being used here).
It appears that using the
viewBinding
delegate causes lint to miss this connection.Stats
Build: AI-193.6911.18.40.6401094, 202004161710,
AI-193.6911.18.40.6401094, JRE 1.8.0_242-release-1644-b3-6222593x64 JetBrains s.r.o, OS Mac OS X(x86_64) v10.15.4, screens 2560x1440
AS: 4.0 Beta 5; Kotlin plugin: 1.3.72-release-Studio4.0-1; Android Gradle Plugin: 4.0.0-beta05; Gradle: 6.1.1; NDK: from local.properties: (not specified), latest from SDK: (not found); LLDB: pinned revision 3.1 not found, latest from SDK: (package not found); CMake: from local.properties: (not specified), latest from SDK: (not found), from PATH: 3.17.2