New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Snackbar] Gradle lint task fails inconsistently: WrongConstant #504
Comments
I'm experiencing this one with beta01 |
@erikhuizinga How can I prevent this issue for now until not fixed? |
@sam4444 don't use a version greater than v1.1.0-alpha-07. |
Still happening in 1.2.0 alpha-01
|
This is still an issue with Material v1.2.0-alpha03. |
Seems to not be an issue on alpha05. |
This seems to be happening during certain builds for alpha05 and alpha06. I found a workaround for these versions, by changing the Build Variant and forcing the project to re-index everything and then run the lint (or assemble) task again. |
@kevinvillalobosGL how did you fix the problem? I already did: Refresh Gradle Dependencies, Reimport Gradle Project, Clear cache and restart, delete build folder, clear project, rebuild project. The problem persists. |
The issue persists, especially on our CI, changing the Build Variant is only a workaround to force the the re-index and clean build, but still could happen. So we decided to disable the abortOnError:
We do have a custom Lint check on our UnitTest so we are keeping this disabled until we get a working solution from the Material Library. |
@kevinvillalobosGL I forgot to mention, I changed the BuildVariant but didn't work either. Using the abortOnError, it will work, thank you. Meanwhile, I'm using a different workaround. I add this annotation to the method with the crashing code. The suppress can be added to the lint.xml file, but in my case, I use the Snackbar.LENGTH_INFINITE in just one place in the project. |
Hello all, what versions of Android Studio and the Android Gradle Plugin are you using to reproduce these errors? |
@dsn5ft using AS 3.6.2. Didn't test with 3.6.3 that I've just updated. Gradle plugin 3.6.2. |
Issue is still present in material library version 1.3.0* and 1.2.0* (* means all minor versions). Android API version 29|28 Solved it by disabling the warning WrongConstant, but this is not good. Please resolve this issue. |
+1 we are also experiencing this issue on v1.2.0 Target: 29, Gradle 4.0.1 |
+1 same issue |
+1 same issue Workaround: |
Any updates to resolve this issue? |
Same here. |
I can't reproduce this in my old project, back when I had this issue and reported it. That project had too many dependencies back then that are now obsolete, which makes it impossible to build it at all. Currently the project depends on Material 1.4.0 and that doesn't seem to have this issue. I tried 20 builds without suppressing the lint error and they all passed. |
Thank you so much for the confirmation. If that's the case I guess the issue was solved even before the commit I linked. : ) |
I confirm that issue is not present in 1.5.0 version. Hope this info helps someone. |
@azaricstefan Thanks for your confirmation! That's helpful. : ) |
Description:
./gradlew lint
would fail on Material v1.1.0-alpha07 and before, and Android Studio would show a lint error forSnackbar.make(view, "Replace with your own action", BaseTransientBottomBar.LENGTH_LONG)
with aWrongConstant
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:
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
The text was updated successfully, but these errors were encountered: