Comments (5)
More issue info: MainActivity
is in Kotlin, BaseActivity
is in Java. Kotlin classes are not visible to the annotation processor.
from dagger.
How was this resolved?
I face the same problem and use kapt for the dagger processor. Shouldn't that solve the issue?
from dagger.
That note is there because if you provide or inject a class that has an @Inject
annotation but you didn't run Dagger over that class, Dagger generates the required code for that class lazily but reminds you that you should explicitly run the processor yourself.
We had a bug where Dagger emitted that note even for classes that don't have an @Inject
annotation at all, even if you do run the Dagger processor over that class. I guess your MainActivity counts.
The bug is now fixed at head, and will be pushed in the next snapshot.
from dagger.
I do have that issue since I switched to kotlin.
kapt "com.google.dagger:dagger-compiler:$daggerVersion"
Shouldn't that make dagger generate the code?
from dagger.
I don't know Kotlin or kapt. And you haven't included your MainActivity source code, so I'm guessing here.
But if MainActivity does not have any @Inject
annotations itself, maybe instead relying on some in its superclasses, then even if you successfully run Dagger over that class it doesn't see any reason to generate a MainActivity_MembersInjector
class in advance. Then when it processes your @Component
, it realizes you need a MembersInjector<MainActivity>
, so it generates one just-in-time and emits that note.
The bug (now fixed at head) is that it emits the note telling you to run Dagger over the MainActivity
class even if you did run Dagger over the MainActivity
class because it can't tell the difference between didn't-run and ran-but-didn't-generate-code.
from dagger.
Related Issues (20)
- CVE-2976 HOT 1
- [KSP] Performance regression vs KAPT HOT 7
- KSP: Consistently failing build in first run and success on second run HOT 8
- Lots of warnings with KSP related to incremental compilation HOT 8
- ComponentProcessingStep was unable to process 'com.example.lab0.App_HiltComponents.SingletonC' because '<error>' could not be resolved. HOT 8
- getViewModel crash intermittently with NullPointerException / IllegalArgumentException HOT 3
- [KSP] internal @Provides method produces non-compiling code using dagger-android HOT 5
- [KSP] dagger-android unresolved generated subcomponent for internal module methods used across gradle modules HOT 3
- Unable to build with 2.48.1 - 2.49 and 2.50 HOT 2
- KSP processing does not see member injections from typealiased superclass in 2.50 HOT 2
- Regression "warning: [cast] redundant cast to Map" when updating from 2.49 to 2.50 HOT 1
- Dagger-Hilt 2.49: Activity onCreate() and onDestroy() code is generated, but our base Activity class has these final HOT 3
- Dagger 2.50 produces code that calls deprecated method HOT 1
- Feature Request: lint rule for EarlyAccessPoint classes to prevent @Inject abuse HOT 13
- no
- Feature request: Add support for K2 compiler. HOT 2
- @HiltViewModel Unit test problem. HOT 2
- WorkerAssistedFactories are not created on APK builds HOT 5
- Getting `Unexpected annotation value: TransformedVisibilityMarker` error during unit test HOT 5
- @BindsInstance on Component.Factory supertype lambda parameters HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dagger.