I am writing a simple application - one activity, two fragments. When I run it, everything works fine, but in the window Android MonitorI see these log messages:
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v4/app/Fragment;.performSaveInstanceState (Landroid/os/Bundle;)V from Lcom/myapp/views/fragments/LocationSearchFragment;)
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: Could not find method android.support.v4.app.Fragment.performSaveInstanceState, referenced from method com.myapp.views.fragments.LocationSearchFragment.access$super
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v4/app/Fragment;.restoreViewState (Landroid/os/Bundle;)V from Lcom/myapp/views/fragments/LocationSearchFragment;)
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: Could not find method android.support.v4.app.Fragment.restoreViewState, referenced from method com.myapp.views.fragments.LocationSearchFragment.access$super
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v4/app/Fragment;.performCreateView (Landroid/view/LayoutInflater;Landroid/view/ViewGroup;Landroid/os/Bundle;)Landroid/view/View; from Lcom/myapp/views/fragments/LocationSearchFragment;)
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: Could not find method android.support.v4.app.Fragment.performCreateView, referenced from method com.myapp.views.fragments.LocationSearchFragment.access$super
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v4/app/Fragment;.performPrepareOptionsMenu (Landroid/view/Menu;)Z from Lcom/myapp/views/fragments/LocationSearchFragment;)
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: Could not find method android.support.v4.app.Fragment.performPrepareOptionsMenu, referenced from method com.myapp.views.fragments.LocationSearchFragment.access$super
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v4/app/Fragment;.performStop ()V from Lcom/myapp/views/fragments/LocationSearchFragment;)
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: Could not find method android.support.v4.app.Fragment.performStop, referenced from method com.myapp.views.fragments.LocationSearchFragment.access$super
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v4/app/Fragment;.performCreateOptionsMenu (Landroid/view/Menu;Landroid/view/MenuInflater;)Z from Lcom/myapp/views/fragments/LocationSearchFragment;)
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: Could not find method android.support.v4.app.Fragment.performCreateOptionsMenu, referenced from method com.myapp.views.fragments.LocationSearchFragment.access$super
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v4/app/Fragment;.performOptionsItemSelected (Landroid/view/MenuItem;)Z from Lcom/myapp/views/fragments/LocationSearchFragment;)
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: Could not find method android.support.v4.app.Fragment.performOptionsItemSelected, referenced from method com.myapp.views.fragments.LocationSearchFragment.access$super
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v4/app/Fragment;.performConfigurationChanged (Landroid/content/res/Configuration;)V from Lcom/myapp/views/fragments/LocationSearchFragment;)
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: Could not find method android.support.v4.app.Fragment.performConfigurationChanged, referenced from method com.myapp.views.fragments.LocationSearchFragment.access$super
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v4/app/Fragment;.performResume ()V from Lcom/myapp/views/fragments/LocationSearchFragment;)
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: Could not find method android.support.v4.app.Fragment.performResume, referenced from method com.myapp.views.fragments.LocationSearchFragment.access$super
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v4/app/Fragment;.setIndex (ILandroid/support/v4/app/Fragment;)V from Lcom/myapp/views/fragments/LocationSearchFragment;)
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: Could not find method android.support.v4.app.Fragment.setIndex, referenced from method com.myapp.views.fragments.LocationSearchFragment.access$super
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v4/app/Fragment;.initState ()V from Lcom/myapp/views/fragments/LocationSearchFragment;)
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: Could not find method android.support.v4.app.Fragment.initState, referenced from method com.myapp.views.fragments.LocationSearchFragment.access$super
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v4/app/Fragment;.findFragmentByWho (Ljava/lang/String;)Landroid/support/v4/app/Fragment; from Lcom/myapp/views/fragments/LocationSearchFragment;)
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: Could not find method android.support.v4.app.Fragment.findFragmentByWho, referenced from method com.myapp.views.fragments.LocationSearchFragment.access$super
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v4/app/Fragment;.performCreate (Landroid/os/Bundle;)V from Lcom/myapp/views/fragments/LocationSearchFragment;)
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: Could not find method android.support.v4.app.Fragment.performCreate, referenced from method com.myapp.views.fragments.LocationSearchFragment.access$super
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v4/app/Fragment;.instantiateChildFragmentManager ()V from Lcom/myapp/views/fragments/LocationSearchFragment;)
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: Could not find method android.support.v4.app.Fragment.instantiateChildFragmentManager, referenced from method com.myapp.views.fragments.LocationSearchFragment.access$super
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v4/app/Fragment;.performActivityCreated (Landroid/os/Bundle;)V from Lcom/myapp/views/fragments/LocationSearchFragment;)
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: Could not find method android.support.v4.app.Fragment.performActivityCreated, referenced from method com.myapp.views.fragments.LocationSearchFragment.access$super
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v4/app/Fragment;.isInBackStack ()Z from Lcom/myapp/views/fragments/LocationSearchFragment;)
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: Could not find method android.support.v4.app.Fragment.isInBackStack, referenced from method com.myapp.views.fragments.LocationSearchFragment.access$super
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v4/app/Fragment;.performPause ()V from Lcom/myapp/views/fragments/LocationSearchFragment;)
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: Could not find method android.support.v4.app.Fragment.performPause, referenced from method com.myapp.views.fragments.LocationSearchFragment.access$super
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v4/app/Fragment;.performReallyStop ()V from Lcom/myapp/views/fragments/LocationSearchFragment;)
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: Could not find method android.support.v4.app.Fragment.performReallyStop, referenced from method com.myapp.views.fragments.LocationSearchFragment.access$super
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v4/app/Fragment;.performContextItemSelected (Landroid/view/MenuItem;)Z from Lcom/myapp/views/fragments/LocationSearchFragment;)
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: Could not find method android.support.v4.app.Fragment.performContextItemSelected, referenced from method com.myapp.views.fragments.LocationSearchFragment.access$super
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v4/app/Fragment;.performDestroyView ()V from Lcom/myapp/views/fragments/LocationSearchFragment;)
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: Could not find method android.support.v4.app.Fragment.performDestroyView, referenced from method com.myapp.views.fragments.LocationSearchFragment.access$super
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v4/app/Fragment;.performStart ()V from Lcom/myapp/views/fragments/LocationSearchFragment;)
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: Could not find method android.support.v4.app.Fragment.performStart, referenced from method com.myapp.views.fragments.LocationSearchFragment.access$super
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v4/app/Fragment;.performDestroy ()V from Lcom/myapp/views/fragments/LocationSearchFragment;)
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: Could not find method android.support.v4.app.Fragment.performDestroy, referenced from method com.myapp.views.fragments.LocationSearchFragment.access$super
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v4/app/Fragment;.performLowMemory ()V from Lcom/myapp/views/fragments/LocationSearchFragment;)
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: Could not find method android.support.v4.app.Fragment.performLowMemory, referenced from method com.myapp.views.fragments.LocationSearchFragment.access$super
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v4/app/Fragment;.performOptionsMenuClosed (Landroid/view/Menu;)V from Lcom/myapp/views/fragments/LocationSearchFragment;)
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: Could not find method android.support.v4.app.Fragment.performOptionsMenuClosed, referenced from method com.myapp.views.fragments.LocationSearchFragment.access$super
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: DexOpt: illegal method access (call Ldagger/internal/Binding;.isSingleton ()Z from Lcom/myapp/di/DiModule$$ModuleAdapter$ProvideLocationServiceProvidesAdapter;)
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: Could not find method dagger.internal.Binding.isSingleton, referenced from method com.myapp.di.DiModule$$ModuleAdapter$ProvideLocationServiceProvidesAdapter.access$super
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: DexOpt: illegal method access (call Ldagger/internal/Binding;.setLinked ()V from Lcom/myapp/di/DiModule$$ModuleAdapter$ProvideLocationServiceProvidesAdapter;)
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: Could not find method dagger.internal.Binding.setLinked, referenced from method com.myapp.di.DiModule$$ModuleAdapter$ProvideLocationServiceProvidesAdapter.access$super
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: DexOpt: illegal method access (call Ldagger/internal/Binding;.isSingleton ()Z from Lcom/myapp/viewModels/LocationSearchViewModel$$InjectAdapter;)
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: Could not find method dagger.internal.Binding.isSingleton, referenced from method com.myapp.viewModels.LocationSearchViewModel$$InjectAdapter.access$super
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: DexOpt: illegal method access (call Ldagger/internal/Binding;.setLinked ()V from Lcom/myapp/viewModels/LocationSearchViewModel$$InjectAdapter;)
06-13 16:21:36.617 6417-6417/com.myapp I/dalvikvm: Could not find method dagger.internal.Binding.setLinked, referenced from method com.myapp.viewModels.LocationSearchViewModel$$InjectAdapter.access$super
06-13 16:21:36.637 6417-6417/com.myapp I/dalvikvm: DexOpt: illegal method access (call Landroid/databinding/ViewDataBinding;.forceExecuteBindings ()V from Lcom/myapp/databinding/FragmentLocationSearchBinding;)
06-13 16:21:36.637 6417-6417/com.myapp I/dalvikvm: Could not find method android.databinding.ViewDataBinding.forceExecuteBindings, referenced from method com.myapp.databinding.FragmentLocationSearchBinding.access$super
06-13 16:21:36.637 6417-6417/com.myapp W/dalvikvm: DexOpt: resolve class illegal access: Lcom/myapp/databinding/FragmentLocationSearchBinding; -> Landroid/databinding/ViewDataBinding$CreateWeakListener;
06-13 16:21:36.637 6417-6417/com.myapp E/dalvikvm: Could not find class 'android.databinding.ViewDataBinding$CreateWeakListener', referenced from method com.myapp.databinding.FragmentLocationSearchBinding.access$super
06-13 16:21:36.637 6417-6417/com.myapp W/dalvikvm: VFY: unable to resolve check-cast 166 (Landroid/databinding/ViewDataBinding$CreateWeakListener;) in Lcom/myapp/databinding/FragmentLocationSearchBinding;
Is it caused by an engine databindingor library dagger? The above errors mention the class LocationSearchFragment, so maybe this code will be useful to you:
public class LocationSearchFragment extends Fragment {
private FragmentLocationSearchBinding mBinding;
public LocationSearchFragment() { }
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
Context context = getContext();
ObjectGraph diGraph = ObjectGraph.create(new DiModule(context));
LocationSearchViewModel vm = diGraph.get(LocationSearchViewModel.class);
mBinding = DataBindingUtil.inflate(
LayoutInflater.from(context),
R.layout.fragment_location_search,
container,
false);
mBinding.setDataContext(vm);
return mBinding.getRoot();
}
}