Open man-dh opened 3 years ago
Hi! Sorry but i haven't already implemented class qualifiers (@ClassKey
), so if you need qualifiers you must use @Named
The issue is possibly somewhere else - even without the ClassKey
it won't work.
I created two Dummy controllers to try to figure out what's going on. One that extends Controller
Directly and one that extends my BaseController
which extends Controller
The first one doesn't even compile:
@ConductorEntryPoint
class DummyController(args: Bundle?) : Controller(args) {
@Inject
lateinit var viewModel: ViewModel
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup,
savedViewState: Bundle?
): View {
System.out.println()
val view = inflater.inflate(R.layout.controller_dummy_layout, container, false)
return view
}
}
The error is: Cause: no such class: .....DummyControllerHiltInterface
The second one does compile:
@ConductorEntryPoint
class DummyController2: BaseController<ControllerDummyLayoutBinding>() {
@Inject lateinit var viewModel: ViewModel
override fun attachVariables(viewBinding: ControllerDummyLayoutBinding) {
}
override fun onViewBound(viewBinding: ControllerDummyLayoutBinding) {
}
override fun getLayout() = R.layout.controller_dummy_layout
}
But the dependencies are not there and it crashes shortly after it's launched with this error:
The ViewModel
class looks like that:
class ViewModel @Inject constructor(private val dependency1: Dependency1) {
class Dependency1 @Inject constructor() {}
}
Could i have your dummy project to inspect which is the problem?
I am trying to make use of your library, and thanks for sharing it - but I cannot make it work.
I am using compile and target SDK 31 Any recommendations?