tcking / GiraffePlayer2

out of the box android video player(support lazy load, ListView/RecyclerView and hight performance)
Apache License 2.0
377 stars 110 forks source link

inflate error (on activity) #79

Closed nemdaz closed 6 years ago

nemdaz commented 6 years ago

Implementation on Activity

protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_video_play); mVideoView = (VideoView) findViewById(R.id.videoView); ... }

On layout

        <tcking.github.com.giraffeplayer2.VideoView
            android:id="@+id/videoView"
            android:layout_width="match_parent"
            android:layout_height="200dp"
            android:visibility="visible"
            tools:visibility="visible" />

Error

03-25 23:28:30.308 29311-29311/com.app.master E/AndroidRuntime: FATAL EXCEPTION: main Process: com.app.master, PID: 29311 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.app.master/com.app.master.activity.ServerActivity}: android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Error inflating class tcking.github.com.giraffeplayer2.VideoView at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2796) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2867) at android.app.ActivityThread.-wrap12(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1570) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:156) at android.app.ActivityThread.main(ActivityThread.java:6595) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832) Caused by: android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Error inflating class tcking.github.com.giraffeplayer2.VideoView Caused by: android.view.InflateException: Binary XML file line #0: Error inflating class tcking.github.com.giraffeplayer2.VideoView Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.newInstance0(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:430) at android.view.LayoutInflater.createView(LayoutInflater.java:656) at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.createCustomViewInternal(CalligraphyLayoutInflater.java:211) at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.access$000(CalligraphyLayoutInflater.java:20) at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater$PrivateWrapperFactory2.onCreateView(CalligraphyLayoutInflater.java:302) at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:189) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:788) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:738) at android.view.LayoutInflater.rInflate(LayoutInflater.java:869) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:832) at android.view.LayoutInflater.rInflate(LayoutInflater.java:872) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:832) at android.view.LayoutInflater.rInflate(LayoutInflater.java:872) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:832) at android.view.LayoutInflater.inflate(LayoutInflater.java:518) at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.inflate(CalligraphyLayoutInflater.java:60) at android.view.LayoutInflater.inflate(LayoutInflater.java:426) at android.view.LayoutInflater.inflate(LayoutInflater.java:377) at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:292) at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) at com.app.master.activity.ServerActivity.onCreate(ServerActivity.java:144) at android.app.Activity.performCreate(Activity.java:6910) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2749) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2867) at android.app.ActivityThread.-wrap12(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1570) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:156) at android.app.ActivityThread.main(ActivityThread.java:6595) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832) 03-25 23:28:30.308 29311-29311/com.app.master E/AndroidRuntime: Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/github/tcking/viewquery/ViewQuery; at tcking.github.com.giraffeplayer2.BaseMediaController.bind(BaseMediaController.java:46) at tcking.github.com.giraffeplayer2.VideoView.initMediaController(VideoView.java:92) at tcking.github.com.giraffeplayer2.VideoView.init(VideoView.java:84) at tcking.github.com.giraffeplayer2.VideoView.<init>(VideoView.java:64) ... 34 more Caused by: java.lang.ClassNotFoundException: Didn't find class "com.github.tcking.viewquery.ViewQuery" on path: DexPathList[[zip file "/data/app/com.app.master-1/base.apk", zip file "/data/app/com.app.master-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.app.master-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.app.master-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.app.master-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.app.master-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.app.master-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.app.master-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.app.master-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.app.master-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.app.master-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.app.master-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.app.master-1/lib/arm64, /system/lib64, /vendor/lib64, /system/vendor/lib64, /product/lib64]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) at java.lang.ClassLoader.loadClass(ClassLoader.java:380) at java.lang.ClassLoader.loadClass(ClassLoader.java:312) ... 38 more

tcking commented 6 years ago

com/github/tcking/viewquery/ViewQuery is one of dependency,do you import the GiraffePlayer with gradle?

nemdaz commented 6 years ago

I download GiraffePlayer2 (cloned) and generate aar of library because I need make small changes. I use gradle build to generate aar. I don't remove dependencies.

tcking commented 6 years ago

do you add compile 'com.github.tcking:viewquery:1.6' ?

nemdaz commented 6 years ago

Thank you, worked for me.

Add in main project: compile 'com.github.tcking:viewquery:1.6' compile 'com.github.tcking:ijkplayer-java:0.8.8'