Espresso test fails with java.lang.String cannot be cast to com.abc.events.databinding.SponsorDetailBinding
问题 I get this error when my espresso test runs with android databinding on the fragment layout. I dont see any crash when I use the app. Is there anyway I can avoid this? onCreateView method in fragment: @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment SponsorDetailBinding mBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_sponsordetail, container, false); return mBinding.getRoot(); }