AGP 7.0.0-alpha13: lint task fails
See original GitHub issueWhen running the lint task with AGP 7.0.0-alpha13 it will fail with the following error:
The lint detector
timber.lint.WrongTimberUsageDetector
called context.getMainProject() during module analysis.
This does not work correctly when running in cli.
In particular, there may be false positives or false negatives because
the lint check may be using the minSdkVersion or manifest information
from the library instead of any consuming app module.
Contact the vendor of the lint issue to get it fixed/updated (if
known, listed below), and in the meantime you can try to work around
this by disabling the following issues:
"LogNotTimber","StringFormatInTimber","ThrowableNotAtBeginning","BinaryOperationInTimber","TimberArgCount","TimberArgTypes","TimberTagLength","TimberExceptionLogging"
Issue Vendors:
Identifier: timber-4.7.1
Call stack: Context.getMainProject(Context.kt:117)
←WrongTimberUsageDetector.visitMethod(WrongTimberUsageDetector.java:80)
←Detector.visitMethodCall(Detector.kt:551)
←UElementVisitor$DelegatingPsiVisitor.visitMethodCallExpression(UElementVisitor.kt:1095)
←UElementVisitor$DelegatingPsiVisitor.visitCallExpression(UElementVisitor.kt:1075)
←KotlinUFunctionCallExpression.accept(KotlinUFunctionCallExpression.kt:186)
←UQualifiedReferenceExpression$DefaultImpls.accept(UQualifiedReferenceExpression.kt:34)
←KotlinUQualifiedReferenceExpression.accept(KotlinUQualifiedReferenceExpression.kt:29)
←UQualifiedReferenceExpression$DefaultImpls.accept(UQualifiedReferenceExpression.kt:33)
←KotlinUQualifiedReferenceExpression.accept(KotlinUQualifiedReferenceExpression.kt:29)
←ImplementationUtilsKt.acceptList(implementationUtils.kt:23)
←UBlockExpression$DefaultImpls.accept(UBlockExpression.kt:21)
←KotlinUBlockExpression.accept(KotlinUBlockExpression.kt:24)
←ULambdaExpression$DefaultImpls.accept(ULambdaExpression.kt:33)
←KotlinULambdaExpression.accept(KotlinULambdaExpression.kt:29)
←ImplementationUtilsKt.acceptList(implementationUtils.kt:23)
←KotlinUFunctionCallExpression.accept(KotlinUFunctionCallExpression.kt:190)
←UQualifiedReferenceExpression$DefaultImpls.accept(UQualifiedReferenceExpression.kt:33)
←KotlinUQualifiedReferenceExpression.accept(KotlinUQualifiedReferenceExpression.kt:29)
←ImplementationUtilsKt.acceptList(implementationUtils.kt:23)
Everything works fine when using AGP 7.0.0-alpha12. Disabling the issues obviously works as a temporary workaround.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:15
- Comments:20 (3 by maintainers)
Top Results From Across the Web
Lint failing on AGP 7.0 with "Can't initialize detector ...
It starts to fail for our root `:app` module, logs attached. The proposed workaround doesn't work. Tasks for other modules are working fine....
Read more >gradle build fails on lint task - android - Stack Overflow
When I run the application from Android Studio, the build runs fine and executes correctly on my devices. But when I try (from...
Read more >Known issues with Android Studio and Android Gradle Plugin
Missing lint output: There is no lint text output printed to stdout when the lint task is UP-TO-DATE (issue #191897708). Fixed in AGP...
Read more >Speed up your app builds with the new Android Gradle plugin
Since the end of 2020, the Android Gradle Plugin (AGP) has started to ... Starting from Android Gradle plugin version 7.0, Lint tasks...
Read more >Android User Guide - Google Samples
The Gradle plugin now maps the lint task to the default variant's lint task instead of ... As of AGP 7.0, it's possible...
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 Free
Top 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
Any update on this issue?
I have this issue with AGP 7.0.0.