• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

App Inventor Binding has changed its methods?

I've updated my build.gradle (Module: app) with a newer implementation of 'kotlin-kapt' and implemented the navigation plugin.

Android Studio has now highlighted these lines as errors inside the onCreateView function of my Fragments:

private lateinit var binding: FragmentPrincipalBinding

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
binding = DataBindingUtil.inflate(inflater, R.layout.fragment_principal, container, false)
[...]
-> binding.setLifecycleOwner(this) <-
[...]
-> return binding.root() <-
}

The methods are now not avaiable for the binding object so, how do I do the Lifecycle owning of the binding for the Fragment? And what do I return now?
 
Surprisingly, the errors have disappeared this morning and now it all works properly. Idk why. I've just shutdown, sleep for 8 hours and when I've run Android Studio again the errors have disappeared and the lines highlighted (binding.setLifecycleOwner(this) & return binding.root()) are now not-highlighted.

The error was that my binding object didn't "had avaiable" the setLifecycleOwner and root methods when I wrote the dot after "binding" and when I wrote them the IDE just highlighted them o_O

Sorry for the inconvenience. I've just lost two hours of my life searching when I just had to turn off and on again :( but worth it because it's now solved and I can continue :):)
 
Back
Top Bottom