EventBus icon indicating copy to clipboard operation
EventBus copied to clipboard

NoClassDefFoundError on Android , java.lang.invoke.SerializedLambda

Open VamPeng opened this issue 4 years ago • 1 comments

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);
}

##-------------------------------------------------------------------

VamPeng avatar Apr 21 '20 10:04 VamPeng

Try using a subscriber index. https://greenrobot.org/eventbus/documentation/subscriber-index/

greenrobot-team avatar May 05 '20 05:05 greenrobot-team