Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KSP breaks Hilt + SqlDelight #452

Open
otormaigh opened this issue Mar 23, 2024 · 1 comment
Open

KSP breaks Hilt + SqlDelight #452

otormaigh opened this issue Mar 23, 2024 · 1 comment

Comments

@otormaigh
Copy link
Owner

e: [ksp] InjectProcessingStep was unable to process 'SmsProviderStore(error.NonExistentClass)' because 'error.NonExistentClass' could not be resolved.

Dependency trace:
=> element (CLASS): ie.otormaigh.lazyotp.data.SmsProviderStore
=> element (CONSTRUCTOR): SmsProviderStore(error.NonExistentClass)
=> type (EXECUTABLE constructor): (error.NonExistentClass)void
=> type (ERROR parameter type): error.NonExistentClass

If type 'error.NonExistentClass' is a generated type, check above for compilation errors that may have prevented the type from being generated. Otherwise, ensure that type 'error.NonExistentClass' is on your classpath.
e: [ksp] InjectProcessingStep was unable to process 'smsCodeProviderQueries' because 'error.NonExistentClass' could not be resolved.

See: google/dagger#4158

@otormaigh
Copy link
Owner Author

Workaround is to add this to the bottom of the app/build.gradle.kts files:

androidComponents {
  onVariants(selector().all()) { variant ->
    afterEvaluate {
      val variantName = variant.name.capitalize()
      tasks.getByName<KotlinCompile>("ksp${variantName}Kotlin") {
        setSource(tasks.getByName("generate${variantName}LazyOtpDatabaseInterface").outputs)
      }
    }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant