ExoVideoView: Error inflating class com.jarvanmo.exoplayerview.ui.ExoVideoView

I just added gradle dependency, then added the ExoVideoView in my layout file and properly handled its working in the Java section. But this exception comes when I launch the activity that contains ExoVideoView.

Caused by: android.view.InflateException: Binary XML file line #15: Error inflating class com.jarvanmo.exoplayerview.ui.ExoVideoView
                                                                       at android.view.LayoutInflater.createView(LayoutInflater.java:620)
                                                                       at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
                                                                       at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
                                                                       at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
                                                                       at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
                                                                       at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
                                                                       at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:289)
                                                                       at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
                                                                       at com.dozydroid.fmp.activities.VideoPlayerActivity.onCreate(VideoPlayerActivity.java:197)
                                                                       at android.app.Activity.performCreate(Activity.java:5343)
                                                                       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1088)
                                                                       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2331)

Here’s peek from my build.gradle

compile 'com.google.android.exoplayer:exoplayer:r2.5.4'
compile 'com.jarvanmo:exoplayerview:1.1.0'
compile 'com.android.support:cardview-v7:26.+'
compile 'com.android.support:support-v4:26.+'
testCompile 'junit:junit:4.12'

My layout.xml file:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:keepScreenOn="true"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:background="#000"
    tools:context=".activities.VideoPlayerActivity">

    <com.jarvanmo.exoplayerview.ui.ExoVideoView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/player_view"
        app:resize_mode="fit"/>
</RelativeLayout>

My Activity.java file:

private ExoVideoView exoVideoView;
protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        exoVideoView = (ExoVideoView) findViewById(R.id.player_view);
        exoVideoView.setPlayer(exoPlayer);
}

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 18 (9 by maintainers)

Most upvoted comments

2.0.0 has been released.