Closed guilherme-pereira-ifood closed 3 years ago
I tried to upgrade Fragment to 1.3.0 and Lifecycle to 2.3.0 on our side, but the crash is still happening.
I've also tried to use the library like in the samples (noreflection):
private val binding by viewBinding(OnboardingContainerFragmentBinding::bind)
But it didn't work too (same crash).
Another useful information: we're using the library with Databinding, not ViewBinding.
The reason is that you access to binding before ViewLifecycleOwner is created. The latest version of the library prevent such kind behaviour. Based on your sample I see this isn't perfect solution. Temporary fix for you is
class OnboardingContainerFragment : BaseFragment() {
private val binding by viewBinding(OnboardingContainerFragmentBinding::bind)
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?,
): View = inflater.inflate(R.layout.onboarding_container_fragment, container, false)
Fix has been added to develop and in few hours version 1.4.4 will be available
We use
noreflection
variant of the library and after upgrading to 1.4.2, the app is now crashing.This is an example of how we've been using it:
And this is the crash we're receiving since 1.4.2:
I'd like your help to understand if we're doing something wrong or if there's a bug on the library.
Thanks!