Development record of developer who study hard everyday.

, , , ,

Required DataBindingComponent is null in class ItemContainerTvShowBindingImpl 해결방법



 java.lang.IllegalStateException: Required DataBindingComponent is null in class ItemContainerTvShowBindingImpl. A BindingAdapter in com.codinginflow.mvvmtvshow.utilities.BindingAdapters is not static and requires an object to use, retrieved from the DataBindingComponent. If you don't use an inflation method taking a DataBindingComponent, use DataBindingUtil.setDefaultComponent or make all BindingAdapter methods static.

class BindingAdapters {

@BindingAdapter("android:imageURL")
fun setImageURL(imageView: ImageView, URL: String){
try {
imageView.alpha = 0f
Picasso.get().load(URL).noFade().into(imageView, object : Callback {
override fun onSuccess() {
imageView.animate().setDuration(300).alpha(1f).start()
}

override fun onError(e: java.lang.Exception?) {

}
})
} catch(ignored: Exception) {

}
}
}
@BindingAdapter를 클래스 안에 넣어서 문제가 발생했다.
클래스 밖에 꺼내주면 해결된다;;









Share:

댓글 없음:

댓글 쓰기