集成百度视频sdk遇到一个巨大的坑,说是坑,其实都是自己的疏忽,没有按照demo好好修改。
E/AndroidRuntime: FATAL EXCEPTION: main Process: mamqu.dong.com.dmo, PID: 23290 java.lang.NoClassDefFoundError: com.baidu.cloud.media.player.a.b$3 at com.baidu.cloud.media.player.a.b.<init>(Unknown Source) at com.baidu.cloud.media.player.a.b.a(Unknown Source) at com.baidu.cloud.media.player.BDCloudMediaPlayer.e(Unknown Source) at com.baidu.cloud.media.player.BDCloudMediaPlayer.setDataSource(Unknown Source) at com.baidu.cloud.media.player.BDCloudMediaPlayer.setDataSource(Unknown Source) at com.baidu.cloud.media.player.BDCloudMediaPlayer.setDataSource(Unknown Source) at mamaxiqu.dong.com.dmo.BDCloudVideoView.openVideo(BDCloudVideoView.java:506) at mamaxiqu.dong.com.dmo.BDCloudVideoView.access$2300(BDCloudVideoView.java:53) at mamaxiqu.dong.com.dmo.BDCloudVideoView$10.onSurfaceCreated(BDCloudVideoView.java:1044) at mamaxiqu.dong.com.dmo.TextureRenderView$SurfaceCallback.onSurfaceTextureAvailable(TextureRenderView.java:283) at android.view.TextureView.getHardwareLayer(TextureView.java:368) at android.view.View.updateDisplayListIfDirty(View.java:15175) at android.view.View.draw(View.java:15971) at android.view.ViewGroup.drawChild(ViewGroup.java:3610) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3400) at android.view.View.updateDisplayListIfDirty(View.java:15193) at android.view.View.draw(View.java:15971) at android.view.ViewGroup.drawChild(ViewGroup.java:3610) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3400) at android.view.View.updateDisplayListIfDirty(View.java:15193) at android.view.View.draw(View.java:15971) at android.view.ViewGroup.drawChild(ViewGroup.java:3610) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3400) at android.view.View.updateDisplayListIfDirty(View.java:15193) at android.view.View.draw(View.java:15971) at android.view.ViewGroup.drawChild(ViewGroup.java:3610) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3400) at android.view.View.updateDisplayListIfDirty(View.java:15193) at android.view.View.draw(View.java:15971) at android.view.ViewGroup.drawChild(ViewGroup.java:3610) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3400) at android.view.View.updateDisplayListIfDirty(View.java:15193) at android.view.View.draw(View.java:15971) at android.view.ViewGroup.drawChild(ViewGroup.java:3610) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3400) at android.view.View.updateDisplayListIfDirty(View.java:15193) at android.view.View.draw(View.java:15971) at android.view.ViewGroup.drawChild(ViewGroup.java:3610) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3400) at android.view.View.draw(View.java:16204) at com.android.internal.policy.PhoneWindow$DecorView.draw(PhoneWindow.java:2690) at android.view.View.updateDisplayListIfDirty(View.java:15198) at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:282) at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:288) at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:323) at android.view.ViewRootImpl.draw(ViewRootImpl.java:2642) at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2461) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2094) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1134) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6050) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:860) at android.view.Choreographer.doCallbacks(Choreographer.java:672) at android.view.Choreographer.doFrame(Choreographer.java:608) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:846) at android.os.Handler.handleCallback(Handler.java:742) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:5527) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)
报出这样的错误,
java.lang.NoClassDefFoundError: com.baidu.cloud.media.player
很明显是这个包在运行的时候不存在。
但是我看我lib下面,这个包是存在的啊,并且里面的方法也有。
搞了一晚上也没搞定。
最后对了一下demo。
原来是因为我没有引入了
implementation files() implementation files()