timber: AGP 7.0.0-alpha13: lint task fails
When 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.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 15
- Comments: 20 (3 by maintainers)
Commits related to this issue
- Ignore Timber Lint errors See https://github.com/JakeWharton/timber/issues/408 — committed to mbarrben/moviedb by mbarrben 3 years ago
- Disable Lint partial analysis Partial Analysis : http://googlesamples.github.io/android-custom-lint-rules/api-guide.html#partialanalysis Currently Timber lint has issue when partial analysis is enab... — committed to simpledotorg/simple-android by deleted user 3 years ago
- Disable Lint partial analysis Partial Analysis : http://googlesamples.github.io/android-custom-lint-rules/api-guide.html#partialanalysis Currently Timber lint has issue when partial analysis is enab... — committed to simpledotorg/simple-android by deleted user 3 years ago
- Bump AGP to v7.0.0 (#2899) * Bump AGP to v7.0.0 * Bump Gradle wrapper to v7.0.2 * Replace deprecated Gradle usages * Disable Lint partial analysis Partial Analysis : http://googlesamples.... — committed to simpledotorg/simple-android by deleted user 3 years ago
- lint: ignore all Timber checks Timber Lint is currently incompatible with AGP 7 See: https://github.com/JakeWharton/timber/issues/408 Related: 9338 — committed to david-allison/Anki-Android by david-allison 3 years ago
- lint: ignore all Timber checks Timber Lint is currently incompatible with AGP 7 See: https://github.com/JakeWharton/timber/issues/408 Related: 9338 — committed to ankidroid/Anki-Android by david-allison 3 years ago
- lint: ignore all Timber checks Timber Lint is currently incompatible with AGP 7 See: https://github.com/JakeWharton/timber/issues/408 Related: 9338 — committed to krmanik/Anki-Android by david-allison 3 years ago
Any update on this issue?
I have this issue with AGP 7.0.0.
I’m still experiencing this issue with:
There are a few PRs waiting to be merged that should fix this.
I am seeing this error with both AGP alpha-13 and alpha-14. It was fine with alpha-12. Can work around it with
android.enableParallelLint=falseingradle.properties.Upgrading our AGP to alpha-14 seems to have solved this issue for us
Getting https://github.com/JakeWharton/timber/pull/410 merged would probably be a step in the right direction (I suppose I should clean up some of the deploy stuff 🤔 ).
Should make it easier to update to AGP 7.0.0 when it is stable (unless doing it pre stable is OK in which case I would just do that).