Repository navigation
Compile issue when updating from 2.57.1 to 2.57.2 #4997
Copy link
Copy link
Open
Description
When trying to upgrade to patch version 2.57.2 (from version 2.57.1), I'm facing the following issue (for the first time):
> Task :app:hiltJavaCompileWeeklyDebug FAILED
error: ComponentProcessingStep was unable to process 'com.comuto.squirrel.MainApp_HiltComponents.SingletonC' because 'io.getstream.chat.android.client.plugin.factory.PluginFactory' could not be resolved.
Dependency trace:
=> element (CLASS): com.comuto.squirrel.android.datasource.chat.di.ChatApiModule
=> element (METHOD): provideOfflinePluginFactory(android.content.Context)
=> type (EXECUTABLE method): (android.content.Context)io.getstream.chat.android.client.plugin.factory.PluginFactory
=> type (ERROR return type): io.getstream.chat.android.client.plugin.factory.PluginFactory
If type 'io.getstream.chat.android.client.plugin.factory.PluginFactory' is a generated type, check above for compilation errors that may have prevented the type from being generated. Otherwise, ensure that type 'io.getstream.chat.android.client.plugin.factory.PluginFactory' is on your classpath.
1 error
error: ComponentProcessingStep was unable to process 'com.comuto.squirrel.MainApp_HiltComponents.SingletonC' because 'io.getstream.chat.android.client.plugin.factory.PluginFactory' could not be resolved.The ChatApiModule of my modularized app exposes the third-party type PluginFactory:
import io.getstream.chat.android.client.plugin.factory.PluginFactory
import io.getstream.chat.android.offline.plugin.factory.StreamOfflinePluginFactory
import io.getstream.chat.android.state.plugin.config.StatePluginConfig
import io.getstream.chat.android.state.plugin.factory.StreamStatePluginFactory
@Module
@InstallIn(SingletonComponent::class)
internal object ChatApiModule {
@Qualifier
@Retention(AnnotationRetention.RUNTIME)
annotation class ClientOfflinePluginFactory
@Qualifier
@Retention(AnnotationRetention.RUNTIME)
annotation class ClientStatePluginFactory
@Provides
@ClientOfflinePluginFactory
fun provideOfflinePluginFactory(@ChatApplicationContext applicationContext: Context): PluginFactory =
StreamOfflinePluginFactory(appContext = applicationContext)
@Provides
@ClientStatePluginFactory
fun provideStatePluginFactory(@ChatApplicationContext applicationContext: Context): PluginFactory =
StreamStatePluginFactory(
appContext = applicationContext,
config = StatePluginConfig(backgroundSyncEnabled = true, userPresence = true)
)
}Here's a preview of the app configuration:
- Gradle 9.1.0
- AGP
8.13.0 :appmodule'sbuild.gradle.kts:plugins { id("com.android.application") id("com.google.devtools.ksp") // KSP version: 2.2.20-2.0.4 id("com.google.dagger.hilt.android") kotlin("android") } hilt { enableAggregatingTask = true } dependencies { implementation(libs.google.hilt.android) // com.google.dagger:hilt-android:2.57.2 ksp(libs.google.hilt.compiler) // com.google.dagger:hilt-compiler:2.57.2 implementation(project(":chat")) // [...] }:chatmodule'sbuild.gradle.kts:plugins { id("com.android.library") id("com.google.devtools.ksp") // KSP version: 2.2.20-2.0.4 kotlin("android") } android { namespace = "com.comuto.squirrel.android.api.chat" } dependencies { implementation(libs.google.hilt.core) // com.google.dagger:hilt-core:2.57.2 ksp(libs.google.hilt.compiler) // com.google.dagger:hilt-compiler:2.57.2 implementation(libs.getStreamChat.client) // io.getstream:stream-chat-android-client:6.24.0 implementation(libs.getStreamChat.offline) // io.getstream:stream-chat-android-offline:6.24.0 implementation(libs.getStreamChat.state) // io.getstream:stream-chat-android-state:6.24.0 // [...] }
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
bcorso commentedon Oct 20, 2025
The issue is that your module's
@Providesmethod is returningPluginFactory, which isn't on the classpath whenever Dagger generates its component in:app.In order to fix it you would either need to change the corresponding dependency to
apiwithin:chat(e.g.dependencies { api(libs.getStreamChat.client) }), or you would need to add the dependency directly to:app.However, I'm not sure what could have caused that change between Dagger 2.57.1 and 2.57.2. That's a restriction that should have been there for years. Are you sure nothing else changed except the Dagger version?
denis-colliot commentedon Oct 20, 2025
Thanks for your quick answer Brad!
I feel like replacing
apiwithimplementationwould break the "modular mindset"; idea is to have a decoupled:chatmodule, abstracting its internal dependencies from its consumers.Declaring these 3rd-party dependencies in the
:appmodule seems to solve the issue ⇒ I guess I'll go with this solution.Positive, I encountered this issue in a Renovate-generated PR that only upgrades the version of the
com.google.dagger:hilt-*dependencies.I'm also very curious to figure out what caused this constraint to be suddenly applied by a patch version 🤔 (I've been using Google Dagger Hilt for years now)
bcorso commentedon Oct 21, 2025
@denis-colliot I met with the team today and @Chang-Eric reminded me that technically Hilt's plugin should already take care of pulling the transitive dependencies onto the classpath (via
enableAggregatingTask). Looking at what changed between Dagger 2.57.1 and 2.57.2 we think the following change be causing the issue:That fix was required for using Gradle 9.0.0, so we'd like to verify if upgrading to Gradle 9.x resolves this issue. Would it be possible for you to upgrade to Gradle 9.x to verify this?
denis-colliot commentedon Oct 22, 2025
Thanks for investigating this issue @bcorso!
The app is using Gradle 9.1.0.
I do agree that the
enableAggregatingTaskconfiguration should already take care of this.pablobaxter commentedon Nov 14, 2025
I had a teammate run into this issue today. What's strange is that no else on the team ran into it, however he was setting up a new machine when he ran into this, so it could potentially be a bug masked by caching. After some digging, we saw that adding dependencies to the
:appmodule resolved his issue. The setup we had:Gradle: 9.2.0
Kotlin: 2.2.21
KSP: 2.3.1
AGP: 8.11.1
adi-gnm commentedon Dec 1, 2025
We're seeing this issue as well. For us, it only occurs on CI, but is blocking Gradle 9 upgrade due to #4847
Gradle: 9.2.1
Kotlin: 2.2.21
KSP: 2.3.3
AGP: 8.13.1
guness commentedon Dec 24, 2025
Having the same issue in a multi module project.
Applied the workaround for now. Using
apiinstead ofimplementationfor the parameters that are provided via Hilt.Any sort of
enableAggregatingTaskor the old one, did not help.