Skip to content

Compile issue when updating from 2.57.1 to 2.57.2 #4997

@denis-colliot

Description

@denis-colliot

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
  • :app module's build.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"))
    
        // [...]
    }
  • :chat module's build.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
    
        // [...]
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions