Giter VIP home page Giter VIP logo

Comments (11)

kuanyingchou avatar kuanyingchou commented on June 12, 2024 8

You need to update your hilt-common, hilt-compiler, and hilt-work to 1.1.0-alpha01.

from dagger.

G00fY2 avatar G00fY2 commented on June 12, 2024 2

@kuanyingchou Maybe worth mentioning in the latest release notes.

from dagger.

kuanyingchou avatar kuanyingchou commented on June 12, 2024 1

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.

G00fY2 avatar G00fY2 commented on June 12, 2024 1

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.

Sutirth avatar Sutirth commented on June 12, 2024 1

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.

JohannesPtaszyk avatar JohannesPtaszyk commented on June 12, 2024

Seems like Room also has to be on 2.6.0-alpha for everything to work, if using room :)

from dagger.

javimar avatar javimar commented on June 12, 2024

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.

Raulsc9 avatar Raulsc9 commented on June 12, 2024

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.

kuanyingchou avatar kuanyingchou commented on June 12, 2024

Hi, @Raulsc9 , it looks like you're missing ksp "androidx.hilt:hilt-compiler:1.1.0-alpha01".

from dagger.

Raulsc9 avatar Raulsc9 commented on June 12, 2024

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.

adonese avatar adonese commented on June 12, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.