使用exoplayer的Unity3d android插件NoClassDefFoundError

时间:2016-11-28 10:28:34

标签: android unity3d exoplayer

我尝试在场景中添加原生对话框以使用exoplayer播放视频。 到目前为止,我已经成功地正确显示了对话框,但是当我开始调用exoplayer时,我在logcat中得到了这个异常:

  

引起:java.lang.NoClassDefFoundError:解析失败:   LCOM / eppz /插件/ DemoPlayer;在   com.eppz.plugins.EPPZ_DialogFragment.preparePlayer(EPPZ_DialogFragment.java:96)   在   com.eppz.plugins.EPPZ_DialogFragment.onCreateView(EPPZ_DialogFragment.java:87)   在android.app.Fragment.performCreateView(Fragment.java:2352)处   android.app.FragmentManagerImpl.moveToState(FragmentManager.java:995)   在   android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1171)   在android.app.BackStackRecord.run(BackStackRecord.java:815)at   android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1578)   在android.app.FragmentManagerImpl $ 1.run(FragmentManager.java:483)at   android.os.Handler.handleCallback(Handler.java:751)at   android.os.Handler.dispatchMessage(Handler.java:95)at   android.os.Looper.loop(Looper.java:154)at   android.app.ActivityThread.main(ActivityThread.java:6077)at   java.lang.reflect.Method.invoke(Native Method)at   com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:865)   在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)引起   by:java.lang.ClassNotFoundException:com.eppz.plugins.DemoPlayer at   java.lang.VMClassLoader.findLoadedClass(Native Method)at   java.lang.ClassLoader.findLoadedClass(ClassLoader.java:742)at   java.lang.ClassLoader.loadClass(ClassLoader.java:362)at   java.lang.ClassLoader.loadClass(ClassLoader.java:312)at   com.eppz.plugins.EPPZ_DialogFragment.preparePlayer(EPPZ_DialogFragment.java:96)   在   com.eppz.plugins.EPPZ_DialogFragment.onCreateView(EPPZ_DialogFragment.java:87)   在android.app.Fragment.performCreateView(Fragment.java:2352)处   android.app.FragmentManagerImpl.moveToState(FragmentManager.java:995)   在   android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1171)   在android.app.BackStackRecord.run(BackStackRecord.java:815)at   android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1578)   在android.app.FragmentManagerImpl $ 1.run(FragmentManager.java:483)at   android.os.Handler.handleCallback(Handler.java:751)at   android.os.Handler.dispatchMessage(Handler.java:95)at   android.os.Looper.loop(Looper.java:154)at   android.app.ActivityThread.main(ActivityThread.java:6077)at   java.lang.reflect.Method.invoke(Native Method)at   com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:865)   在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)   引起:java.lang.NoClassDefFoundError:失败的解决方案:   LCOM /谷歌/安卓/ exoplayer / ExoPlayer $监听;在   com.eppz.plugins.EPPZ_DialogFragment.preparePlayer(EPPZ_DialogFragment.java:96)   在   com.eppz.plugins.EPPZ_DialogFragment.onCreateView(EPPZ_DialogFragment.java:87)   在android.app.Fragment.performCreateView(Fragment.java:2352)处   android.app.FragmentManagerImpl.moveToState(FragmentManager.java:995)   在   android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1171)   在android.app.BackStackRecord.run(BackStackRecord.java:815)at   android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1578)   在android.app.FragmentManagerImpl $ 1.run(FragmentManager.java:483)at   android.os.Handler.handleCallback(Handler.java:751)at   android.os.Handler.dispatchMessage(Handler.java:95)at   android.os.Looper.loop(Looper.java:154)at   android.app.ActivityThread.main(ActivityThread.java:6077)at   java.lang.reflect.Method.invoke(Native Method)at   com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:865)   在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)   引起:java.lang.ClassNotFoundException:没找到类   " com.google.android.exoplayer.ExoPlayer $监听器"在路径上:   DexPathList [[zip文件   " /data/app/com.eppz.plugins.alert-1/base.apk"],nativeLibraryDirectories = [/数据/应用/ com.eppz.plugins.alert-1 / LIB /臂,   /data/app/com.eppz.plugins.alert-1/base.apk!/lib/armeabi-v7a,   / system / lib,/ vendor / lib]]   dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)   在java.lang.ClassLoader.loadClass(ClassLoader.java:380)at   java.lang.ClassLoader.loadClass(ClassLoader.java:312)at   com.eppz.plugins.EPPZ_DialogFragment.preparePlayer(EPPZ_DialogFragment.java:96)   在   com.eppz.plugins.EPPZ_DialogFragment.onCreateView(EPPZ_DialogFragment.java:87)   在android.app.Fragment.performCreateView(Fragment.java:2352)处   android.app.FragmentManagerImpl.moveToState(FragmentManager.java:995)   在   android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1171)   在android.app.BackStackRecord.run(BackStackRecord.java:815)at   android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1578)   在android.app.FragmentManagerImpl $ 1.run(FragmentManager.java:483)at   android.os.Handler.handleCallback(Handler.java:751)at   android.os.Handler.dispatchMessage(Handler.java:95)at   android.os.Looper.loop(Looper.java:154)at   android.app.ActivityThread.main(ActivityThread.java:6077)at   java.lang.reflect.Method.invoke(Native Method)at   com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:865)   在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)

我刚刚添加了一个纹理视图,并在我的android部分添加了exoplayer,就像它是一个普通项目一样。

我不知道我可以添加什么,所以如果您需要更多信息,请随时问:) 有什么想法吗?

此致

1 个答案:

答案 0 :(得分:0)

您必须在Unity项目中将 ExoPlayer 的编译版本添加为.aar.jar,它才能正常运行。