Imany
04/13/2025, 9:11 PMImany
04/13/2025, 9:13 PMkotlin version: 2.1.20
error message: org.jetbrains.kotlin.backend.common.BackendException: Backend Internal error: Exception during IR lowering
File being compiled: /Users/sample/dev/android/projects/MyApp/features/auth/presentation/src/main/java/app/sample/auth/presentation/navigation/AuthNavGraph.kt
The root cause java.lang.RuntimeException was thrown at: org.jetbrains.kotlin.backend.jvm.codegen.FunctionCodegen.generate(FunctionCodegen.kt:48)
...
Caused by: org.jetbrains.kotlin.codegen.CompilationException: Back-end (JVM) Internal error: Couldn't inline method call: CALL 'public final fun hiltViewModel$default <VM> (viewModelStoreOwner: androidx.lifecycle.ViewModelStoreOwner?, key: kotlin.String?, $mask0: <http://kotlin.Int|kotlin.Int>, $handler: kotlin.Any?): VM of androidx.hilt.navigation.compose.HiltViewModelKt.hiltViewModel$default [inline] declared in androidx.hilt.navigation.compose.HiltViewModelKt' type=VM of androidx.hilt.navigation.compose.HiltViewModelKt.hiltViewModel$default origin=DEFAULT_DISPATCH_CALL
Method: null
File is unknown
The root cause java.lang.IllegalStateException was thrown at: org.jetbrains.kotlin.codegen.inline.SourceCompilerForInlineKt.getMethodNode(SourceCompilerForInline.kt:128)
...
Caused by: java.lang.IllegalStateException: couldn't find inline method Landroidx/hilt/navigation/compose/HiltViewModelKt;.hiltViewModel$default(Landroidx/lifecycle/ViewModelStoreOwner;Ljava/lang/String;ILjava/lang/Object;)Landroidx/lifecycle/ViewModel;
at org.jetbrains.kotlin.codegen.inline.SourceCompilerForInlineKt.getMethodNode(SourceCompilerForInline.kt:128)
at org.jetbrains.kotlin.codegen.inline.SourceCompilerForInlineKt.loadCompiledInlineFunction(SourceCompilerForInline.kt:97)
at org.jetbrains.kotlin.backend.jvm.codegen.IrSourceCompilerForInline.compileInlineFunction(IrSourceCompilerForInline.kt:92)
at org.jetbrains.kotlin.codegen.inline.InlineCodegen.compileInline(InlineCodegen.kt:42)
at org.jetbrains.kotlin.codegen.inline.InlineCodegen.performInline(InlineCodegen.kt:50)
... 70 more
Imany
04/13/2025, 9:15 PMLan s
04/14/2025, 3:29 AMLoginScreen(viewmodel=viewmodel){
navController.navigate("signup")
}
You should pass in the viewmodelImany
04/14/2025, 4:59 AMRobert Levonyan
04/14/2025, 5:17 AM@HiltViewModel
annotation to your ViewModel?Imany
04/14/2025, 5:18 AMdagger.hilt.android.lifecycle.HiltViewModel
Robert Levonyan
04/14/2025, 5:22 AMImany
04/14/2025, 5:49 AMRobert Levonyan
04/14/2025, 5:50 AMbuild.gradle
file. Check both hilt
and ksp
versionsImany
04/14/2025, 5:52 AMhilt = "2.51.1"
hiltNavigationCompose = "1.2.0"
I haven't used ksp
for hilt but if it helps:
devtoolKsp = "2.1.20-1.0.32"
Robert Levonyan
04/14/2025, 5:54 AMhilt = "2.56.1"
ksp = "2.1.20-2.0.0"
try with thoseImany
04/14/2025, 6:04 AMRobert Levonyan
04/14/2025, 6:33 AMLan s
04/14/2025, 7:24 AMImany
04/14/2025, 11:25 AMImany
04/14/2025, 11:26 AMhiltNavigationCompose = "1.2.0"
Imany
04/14/2025, 11:29 AMRobert Levonyan
04/14/2025, 11:31 AMRobert Levonyan
04/14/2025, 11:32 AMImany
04/14/2025, 11:46 AMkotlin = "2.1.20"
devtoolKsp = "2.1.20-2.0.0"
Robert Levonyan
04/14/2025, 11:47 AMImany
04/14/2025, 11:47 AMRobert Levonyan
04/14/2025, 11:49 AMImany
04/14/2025, 11:54 AMalias(libs.plugins.google.dagger.hilt.android)
alias(libs.plugins.google.devtool.ksp)
dependencies:
// hilt
implementation(libs.hilt.android)
implementation(libs.hilt.navigation.compose)
// kapt(libs.google.hilt.compiler)
ksp(libs.google.hilt.compiler)
Robert Levonyan
04/14/2025, 12:00 PMSeri
04/14/2025, 3:05 PM