Marko Novaković
09/19/2024, 11:54 AMkotlin-inject
+ kotlin-inject-anvil
and my component is interface ApplicationComponent : ApplicationComponentMerged
which is fine. ApplicationComponentMerged
is generated but ApplicationComponent
can’t access things provided by components that ApplicationComponentMerged
extends/inheritsMarko Novaković
09/19/2024, 11:58 AM@Origin(value = CameraPresenterFactory::class)
public interface CameraPresenterFactory {
@Provides
@IntoSet
public
fun provideCameraPresenterFactoryFactoryMultibinding(cameraPresenterFactory: CameraPresenterFactory):
Presenter.Factory = cameraPresenterFactory
}
-----------------
public interface ApplicationComponentMerged :
TechMappsSevenwondersduelscoringCameraCameraPresenterFactory
---------------
public class InjectApplicationComponent : ApplicationComponent,
but there is an error where provideCameraPresenterFactoryFactoryMultibinding
which exists inside CameraPresenterFactory
gives Unresolved reference:
public class InjectApplicationComponent : ApplicationComponent, ScopedComponent {
override val _scoped: LazyMap = LazyMap()
override val circuit: Circuit
get() = circuit(
presenterFactories = setOf(
provideCameraPresenterFactoryFactoryMultibinding(
cameraPresenterFactory = CameraPresenterFactory()
)
),
uiFactories = setOf(
provideCameraUiFactoryFactoryMultibinding(
cameraUiFactory = CameraUiFactory()
)
)
)
}
ralf
09/19/2024, 7:23 PMapi
vs implementation
dependencies?Marko Novaković
09/19/2024, 10:58 PMralf
09/19/2024, 11:17 PMJosh Feinberg
09/20/2024, 12:18 AMe: file:///.../build/generated/ksp/jvm/jvmMain/kotlin/com/joshafeinberg/common/InjectAppComponent.kt:266:9 Unresolved reference 'provideAddTransactionPresenterFactoryFactoryMultibinding'.
however, in the build folder I do have
@Origin(value = AddTransactionPresenterFactory::class)
public interface
ComJoshafeinbergCommonFeaturesAddtransactionAddTransactionPresenterFactory {
@Provides
@IntoSet
public
fun provideAddTransactionPresenterFactoryFactoryMultibinding(addTransactionPresenterFactory: AddTransactionPresenterFactory):
Presenter.Factory = addTransactionPresenterFactory
}
i'm kind of wondering, and not sure if you have the same problem Marko, if theres something wrong with my gradle setup as I'm getting the IDE a warning of Unresolved reference: AppComponentMerged
even though it compilesralf
09/20/2024, 2:47 AMZac Sweers
09/20/2024, 3:25 AMralf
09/20/2024, 3:42 AMMarko Novaković
09/20/2024, 8:36 AMandroidMain
codegen directory.Josh Feinberg
09/21/2024, 7:25 PM@AppScope
@Component
@MergeComponent
internal abstract class AppComponent(...) : AppComponentMerged2
AppComponentMerged2
is kind of where the magic worked. this is just expect interface AppComponentMerged2
and then in all my sourcesets i have an actual defined as actual interface AppComponentMerged2: AppComponentMerged
So this does seem to be a very similar error to the one Chris reported. this workaround works for now thoughZac Sweers
09/21/2024, 8:20 PMMarko Novaković
09/24/2024, 7:12 PMjava.lang.IllegalStateException: Storage for [.../build/kspCaches/android/androidDebug/symbolLookups/id-to-file.tab] is already registered
with same setup?Zac Sweers
09/24/2024, 7:19 PM