Comments (11)
You need to update your hilt-common, hilt-compiler, and hilt-work to 1.1.0-alpha01.
from dagger.
@kuanyingchou Maybe worth mentioning in the latest release notes.
from dagger.
Hi, @Raulsc9 , it looks like the Room error is working as intended since 2.6.0-alpha01:
https://issuetracker.google.com/issues/68198444
Sorry about the naming but com.google.dagger:hilt-compiler
and androidx.hilt:hilt-compiler
are different things. You'll need both for hilt-work to work.
from dagger.
You need to update your hilt-common, hilt-compiler, and hilt-work to 1.1.0-alpha01.
hilt-compiler-1.1.0-alpha01
transitively depends on Room 2.6.0-alpha03 as you can see in the POM. Therefore you also need to migrate to Room 2.6.0 if you like to use WorkManager with Hilt + KSP.
from dagger.
I am using hilt version: 2.49, Work manager = 2.9.0. Trying to use this in multi module project facing the crash on lateinit workerFactory. Anybody has any recommendation or solution for the same?
from dagger.
Seems like Room also has to be on 2.6.0-alpha for everything to work, if using room :)
from dagger.
I am getting the error for the combo KSP /WorkManager annotated with @HiltWorker. However, KSP seems to be working OK with Room 2.5.2.
from dagger.
You need to update your hilt-common, hilt-compiler, and hilt-work to 1.1.0-alpha01.
I have the same problem as SimoneBari-BS and it is not solved by upgrading to "androidx.hilt:hilt-work:1.1.0-alpha01".
These are my dependencies relative to hilt;
//Dagger - Hilt
implementation "com.google.dagger:hilt-android:2.48"
ksp "com.google.dagger:hilt-compiler:2.48"
implementation 'androidx.hilt:hilt-work:1.1.0-alpha01'
Best regards
from dagger.
Hi, @Raulsc9 , it looks like you're missing ksp "androidx.hilt:hilt-compiler:1.1.0-alpha01"
.
from dagger.
Thanks for your reply, but when I add that line, now I get error in the [@insert, @upsert, @update, @delete] annotations of Room, when I try to compile.
[ksp] C:/path_project.kt:27: Methods annotated with [@Insert, @Upsert, @Update, @Delete] shouldn't declare nullable parameters (com.example.models.MyFile).
It seems that the dependency "ksp "com.google.dagger:hilt-compiler:2.48", prevents nullable parameters being passed to DAO methods.
Currently my hilt and room dependencies are like this;
//Room
implementation "androidx.room:room-runtime:2.6.0-rc01"
ksp "androidx.room:room-compiler:2.6.0-rc01"
implementation "androidx.room:room-ktx:2.6.0-rc01"
//Dagger - Hilt
implementation "com.google.dagger:hilt-android:2.48"
ksp "com.google.dagger:hilt-compiler:2.48"
ksp "androidx.hilt:hilt-compiler:1.1.0-alpha01"
implementation 'androidx.hilt:hilt-work:1.1.0-alpha01'
I've tried removing this line;
ksp "com.google.dagger:hilt-compiler:2.48"
But then I get this error;
The Hilt Android Gradle plugin is applied but no com.google.dagger:hilt-compiler dependency was found.
Everything was working fine before I migrated to KSP. A more detailed explanation would be appreciated, best regards!
from dagger.
have the same error as raulsc9's and still not solved -- using hilt versions 2.48.1 and room version of 2.6.0-alpha03
EDIT:
i ended up having to fix my room models for the nullable [@insert, @upsert, https://github.com/update, @delete] -- after updating room version
from dagger.
Related Issues (20)
- @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
- SecurityException when trying to run UI test with hilt and Jetpack Compose on Android 14 HOT 3
- BadParcelableException in Activity onCreate HOT 3
- Dagger 2.50 KSP fails to generate field in implementation for a @Named field HOT 2
- Conflicting documentation for dagger.android and Hilt optional inject HOT 3
- [KSP] dagger-android hanging indefinitely on a large multi module project HOT 2
- Optional bindings in a parent component can sometimes use bindings from child components HOT 2
- NullPointerException dagger.spi.shaded.androidx.room.compiler.processing.XTypeElement.getAnnotation HOT 6
- Problem with Injection of DAO HOT 1
- error: [Hilt] Could not get element for com.foo.viewModels.FooViewModel_HiltModules.BindsModule: java.lang.NullPointerException HOT 1
- Missing release notes for 2.51 HOT 1
- `LazyClassKey` doesn't work when providing a `Map<Class<*>, Provider<?>` with a scope
- @AssistedInject in ViewModel using Dagger (NOT Hilt, just dagger) does not compile: cannot be provided without an @Inject constructor or an @Provides-annotated method HOT 6
- [issue] Dagger doesn't compile or doesn't give a right error message when ViewModelFactory is implemened on Kotlin rather than on Java HOT 4
- Having an issue with Dagger Hilt Proguard Rules HOT 12
- Following dagger.dev tutorial doesnt create singleton in v2.51 HOT 2
- Multibinding with Nested Complex Keys uses the wrong AnnotationCreator 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.