你好,使用3.9.4版本的jar包,插件使用3.9.0的osgi.jar,调用bundle.start()方法后出现下面类转换异常,获取不到BundleContext,请问是什么原因?
发布于 2 年前 作者 446525753 851 次浏览 来自 问答

03-20 15:09:21.158 17120-17120/com.meapp W/cl: java.lang.BootClassLoader 03-20 15:09:21.168 17120-17120/com.meapp W/System.err: java.lang.ClassCastException: com.plugindemo.SimpleBundle cannot be cast to org.osgi.framework.BundleActivator 03-20 15:09:21.168 17120-17120/com.meapp W/System.err: at org.tengxin.cl.b(Unknown Source) 03-20 15:09:21.168 17120-17120/com.meapp W/System.err: at org.tengxin.cl.j(Unknown Source) 03-20 15:09:21.168 17120-17120/com.meapp W/System.err: at org.tengxin.cl.i(Unknown Source) 03-20 15:09:21.168 17120-17120/com.meapp W/System.err: at org.tengxin.cl.a(Unknown Source) 03-20 15:09:21.168 17120-17120/com.meapp W/System.err: at org.tengxin.bN.start(Unknown Source) 03-20 15:09:21.168 17120-17120/com.meapp W/System.err: at com.meappkit.pluginmanagerkit.PluginManager.startPlugin(PluginManager.java:497) 03-20 15:09:21.168 17120-17120/com.meapp W/System.err: at com.meapp.main.model.MainModel.startPlug(MainModel.java:455) 03-20 15:09:21.168 17120-17120/com.meapp W/System.err: at com.meapp.presenter.MainPresenter.goToPlugManager(MainPresenter.java:229) 03-20 15:09:21.168 17120-17120/com.meapp W/System.err: at com.meapp.presenter.MainPresenter.handleItemOnClick(MainPresenter.java:213) 03-20 15:09:21.168 17120-17120/com.meapp W/System.err: at com.meapp.view.MainActivity.onItemClick(MainActivity.java:211) 03-20 15:09:21.168 17120-17120/com.meapp W/System.err: at com.meapp.main.views.DraggableGridViewPager.onItemClick(DraggableGridViewPager.java:1008) 03-20 15:09:21.168 17120-17120/com.meapp W/System.err: at com.meapp.main.views.DraggableGridViewPager.onTouchEvent(DraggableGridViewPager.java:807) 03-20 15:09:21.168 17120-17120/com.meapp W/System.err: at android.view.View.dispatchTouchEvent(View.java:8968) 03-20 15:09:21.168 17120-17120/com.meapp W/System.err: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2698) 03-20 15:09:21.168 17120-17120/com.meapp W/System.err: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2410) 03-20 15:09:21.168 17120-17120/com.meapp W/System.err: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2709) 03-20 15:09:21.168 17120-17120/com.meapp W/System.err: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2425) 03-20 15:09:21.168 17120-17120/com.meapp W/System.err: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2709) 03-20 15:09:21.168 17120-17120/com.meapp W/System.err: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2425) 03-20 15:09:21.168 17120-17120/com.meapp W/System.err: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2709) 03-20 15:09:21.168 17120-17120/com.meapp W/System.err: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2425) 03-20 15:09:21.168 17120-17120/com.meapp W/System.err: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2709) 03-20 15:09:21.168 17120-17120/com.meapp W/System.err: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2425) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2709) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2425) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2709) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2425) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2709) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2425) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2709) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2425) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2559) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1767) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at android.app.Activity.dispatchTouchEvent(Activity.java:2866) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:60) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2520) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at android.view.View.dispatchPointerEvent(View.java:9173) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4706) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4544) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4068) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4121) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4087) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4201) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4095) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4258) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4068) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4121) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4087) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4095) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4068) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6565) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6455) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6426) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6655) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at android.os.MessageQueue.nativePollOnce(Native Method) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at android.os.MessageQueue.next(MessageQueue.java:143) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at android.os.Looper.loop(Looper.java:130) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at android.app.ActivityThread.main(ActivityThread.java:5942) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at java.lang.reflect.Method.invoke(Native Method) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at java.lang.reflect.Method.invoke(Method.java:372) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400) 03-20 15:09:21.178 17120-17120/com.meapp W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)

1 回复

有可能是你插件里面吧osgi.jar库给打包进去了

回到顶部