EventBus
EventBus copied to clipboard
NoClassDefFoundError on Android , java.lang.invoke.SerializedLambda
Hi ,i got a error: when i register it in Fragment: ##------------------------------------------------------------------- @Override public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); EventBus.getDefault().register(this); }
@Override
public void onDestroyView() {
super.onDestroyView();
EventBus.getDefault().unregister(this);
}
##------------------------------------------------------------------- and this problem occurs when i run app on my phone Caused by: java.lang.ClassNotFoundException: Didn't find class "java.lang.invoke.SerializedLambda" on path: DexPathList[[zip file "/data/app/.....
Could not inspect methods of com.p.component_base.base.BaseFragment. Please make this class visible to EventBus annotation processor to avoid reflection. #------------------------------------------------------------------ @Subscribe public void reEvent(RefreshUserEvent event) {
}
##-----------------------------------------------------------------
by the way,I use MultiDex: #---------------------------------------------------------------- @Override protected void attachBaseContext(Context base) { super.attachBaseContext(base);
MultiDex.install(instance);
}
##-------------------------------------------------------------------
Try using a subscriber index. https://greenrobot.org/eventbus/documentation/subscriber-index/