[Snackbar] Gradle lint task fails inconsistently: WrongConstant
See original GitHub issueDescription:
./gradlew lint
would fail on Material v1.1.0-alpha07 and before, and Android Studio would show a lint error for Snackbar.make(view, "Replace with your own action", BaseTransientBottomBar.LENGTH_LONG)
with a WrongConstant
error. (Snackbar.LENGTH_LONG
should be used instead.)
On v1.1.0-alpha08 and v1.1.0-alpha09 ./gradlew lint
fails sometimes (about half the time) and the Android Studio lint error is no longer shown. This also happens on v1.2.0-alpha03.
Expected behavior:
The Gradle lint task fails or succeeds consistently and Android Studio’s linter reflects this success/failure.
Source code:
Snackbar.make(view, "Replace with your own action", BaseTransientBottomBar.LENGTH_LONG)
Android API version:
28
Material Library version:
OK: v1.1.0-alpha-07 and earlier Not OK: v1.1.0-alpha08, v1.1.0-alpha09, v1.2.0-alpha03
Device:
N/A
Issue Analytics
- State:
- Created 4 years ago
- Reactions:20
- Comments:23 (4 by maintainers)
Top Results From Across the Web
Lint fails the build with Security error "WrongConstant
I know that this error can be simply suppressed. But I'd like to know what's wrong with my code? Or maybe it's another...
Read more >Android Gradle Build & Analyze failed on Lint errors
2] FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:lintDebug'. > Lint found errors in the project; ......
Read more >Finding Unused Gradle Dependencies - Baeldung
Learn how to use the Gradle Nebula Lint plugin to identify and fix unused ... gradlew lintGradle > Task :lintGradle FAILED # failure...
Read more >Android User Guide - Google Samples
The Gradle plugin now maps the lint task to the default variant's lint task instead of running it ... Set the exit code...
Read more >Improve your code with lint checks - Android Developers
Run lint from the command line. If you're using Android Studio or Gradle, you can use the Gradle wrapper to invoke the lint...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
+1 same issue material version: 1.1.0, 1.2.0 API: 29 Gradle 4.0.1
Workaround: lintOptions { disable ‘WrongConstant’ } thx: @azaricstefan
Thank you so much for the confirmation. If that’s the case I guess the issue was solved even before the commit I linked. : )