'org.jetbrains.annotations.NotNull' could not be resolved
See original GitHub issueHello!
I’m an Android developer and I use Dagger in my project. The project is written in Kotlin. I’ve updated Dagger version to 2.41. Since that the project hasn’t built. The build is failed with error:
ComponentProcessingStep was unable to process ‘this.package.name.AppComponent’ because ‘org.jetbrains.annotations.NotNull’ could not be resolved.
I’ve added Gradle dependency in my classpath:
dependencies {
....
compileOnly("org.jetbrains:annotations:23.0.0")
....
kapt("com.google.dagger:dagger-compiler:2.41")
}
but it didn’t help…
How to fix this?
Issue Analytics
- State:
- Created 2 years ago
- Comments:8
Top Results From Across the Web
editor does not find library containing @NotNull annotation
However, the editor fails to find the library. It highlights "jetbrains" in red and says it can't resolve the symbol. Same for @NotNull....
Read more >importing NotNull or Nullable and Android Studio won't compile
Go to File / Setting → Project Settings → Inspections and search for "nullable". In Constant conditions & exceptions and @NotNull/@Nullable problems, click ......
Read more >@org.jetbrains.annotations.NotNull [Solved] - YouTube
org. jetbrains. annotations. NotNull problem in android studio, caused while updating android studio. ... Your browser can't play this video.
Read more >Org.jetbrains.annotations.NotNull problem with android build
Hi. I created a java library project and it uses org.jetbrains.annotations.NotNull annotation. (I added annotations.jar from intellij installation.)
Read more >Databinding v2 produces errors when another annotation ...
MainActivity cannot be provided without an @Inject constructor or an @Provides-annotated method. public abstract void inject(@org.jetbrains.annotations.NotNull ...
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
@bcorso, @tbroyer thank you very much for your replies!
I’ve found the problem. Dependency
org.jetbrains.annotations.NotNull
isn’t needed. I didn’t notice the following in the:app
module gradle file:If I remove this, the project will be built without errors. Exclusion org.jetbrains.annotations from application configurations worked with dagger versions till 2.41
Hmm, is there any way you could create a sample project that reproduces this so that I can take a look?
My only guess is that you’re adding the dependency to the wrong Gradle module. Can you show the task that failed (should be right above the error message, e.g.
> Task :someModule:someTask FAILED
). You’ll want to make sure you’re adding the dependency to the:someModule
Gradle module.