# Kotlin JC/Android Studio - Cant find Hilt

**URL:** <https://discuss.kotlinlang.org/t/kotlin-jc-android-studio-cant-find-hilt/27594>\
**Category:** Uncategorized\
**Created:** [November 6, 2023, 5:45pm UTC](https://discuss.kotlinlang.org/t/kotlin-jc-android-studio-cant-find-hilt/27594 "2023-11-06T17:45:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fornakter](https://avatars.discourse-cdn.com/v4/letter/f/a6a055/32.png) [@fornakter](https://discuss.kotlinlang.org/u/fornakter)\
**Post date:** [November 6, 2023, 5:45pm UTC](https://discuss.kotlinlang.org/t/kotlin-jc-android-studio-cant-find-hilt/27594/1 "2023-11-06T17:45:56Z")

</div>

Hi.  
I try to find a way to repair hilt, Android Studio cant find it.  
Here’s some info  
 ![obraz](https://us1.discourse-cdn.com/flex019/uploads/kotlinlang/original/2X/3/36f8ad7b563fe0b13e608745c95c06ad9e1a1a3d.jpeg)  
 ![obraz](https://us1.discourse-cdn.com/flex019/uploads/kotlinlang/original/2X/2/2ba6fe7ce637f0b6b0c1e21c1193f9cf482b074e.png)

 ![obraz](https://us1.discourse-cdn.com/flex019/uploads/kotlinlang/original/2X/9/9210d669412dac69603513e5876c40a44a418ba2.jpeg)  
 ![obraz](https://us1.discourse-cdn.com/flex019/uploads/kotlinlang/original/2X/6/6631fd64031d79c1177949f753e39f0e570f2f81.png)  
 ![obraz](https://us1.discourse-cdn.com/flex019/uploads/kotlinlang/original/2X/4/44e9e2f26dc271404efeb87f98e89569d61bf374.png)

```auto
    implementation ("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
    implementation ("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.1")
    implementation( "org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.7.1")

    implementation ("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2")
    implementation ("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2")

    implementation ("com.google.dagger:hilt-android:2.48")

    kapt("com.google.dagger:hilt-android-compiler:2.40")
    implementation ("androidx.hilt:hilt-lifecycle-viewmodel:1.0.0-alpha03")
    implementation("androidx.hilt:hilt-navigation-compose:1.1.0")

    implementation ("com.squareup.retrofit2:retrofit:2.9.0")
    implementation ("com.squareup.retrofit2:converter-gson:2.9.0")

    implementation("androidx.core:core-ktx:1.12.0")
    implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2")
    implementation("androidx.activity:activity-compose:1.8.0")
    implementation(platform("androidx.compose:compose-bom:2023.03.00"))
    implementation("androidx.compose.ui:ui")
    implementation("androidx.compose.ui:ui-graphics")
    implementation("androidx.compose.ui:ui-tooling-preview")
    implementation("androidx.compose.material3:material3")
    testImplementation("junit:junit:4.13.2")
    androidTestImplementation("androidx.test.ext:junit:1.1.5")
    androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
    androidTestImplementation(platform("androidx.compose:compose-bom:2023.03.00"))
    androidTestImplementation("androidx.compose.ui:ui-test-junit4")
    debugImplementation("androidx.compose.ui:ui-tooling")
    debugImplementation("androidx.compose.ui:ui-test-manifest")

```

Error is always the same (on pic).

---

<div class="post-metadata">

**Author:** ![Skater901](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/skater901/32/10163_2.png) [@Skater901](https://discuss.kotlinlang.org/u/Skater901)\
**Post date:** [November 11, 2023, 12:30am UTC](https://discuss.kotlinlang.org/t/kotlin-jc-android-studio-cant-find-hilt/27594/2 "2023-11-11T00:30:50Z")

</div>

Do you have any plugins working? It looks like Gradle hasn’t resolved any of your plugins.

In my experience, if Gradle is broken, it really doesn’t recover well. I would try commenting out the hilt plugin and seeing if you can get everything else working and resolving, then try adding it again.

---

<div class="post-metadata">

**Author:** ![fornakter](https://avatars.discourse-cdn.com/v4/letter/f/a6a055/32.png) [@fornakter](https://discuss.kotlinlang.org/u/fornakter)\
**Post date:** [November 11, 2023, 5:47pm UTC](https://discuss.kotlinlang.org/t/kotlin-jc-android-studio-cant-find-hilt/27594/3 "2023-11-11T17:47:19Z")

</div>

Yea, it was gradle, on course when i learn they dont say that and i lose few days to find a solution.

---

<div class="post-metadata">

**Author:** ![Skater901](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/skater901/32/10163_2.png) [@Skater901](https://discuss.kotlinlang.org/u/Skater901)\
**Post date:** [November 12, 2023, 12:18am UTC](https://discuss.kotlinlang.org/t/kotlin-jc-android-studio-cant-find-hilt/27594/4 "2023-11-12T00:18:21Z")

</div>

I found this: [Gradle Build Setup](https://dagger.dev/hilt/gradle-setup.html)

```auto
plugins {
  // other plugins...
  id 'com.google.dagger.hilt.android' version '2.48.1' apply false
}

```

That works for me (although I didn’t use the `apply false`; I think that’s only if you have a parent project with sub projects). Note that the plugin name is different (‘com.google.dagger.hilt.android’ vs ‘dagger.hilt.android.plugin’), and that a version is specified; it didn’t work until I specified a version.
