question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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);
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:18 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
JarvanMocommented, Feb 10, 2018

2.0.0 has been released.

0reactions
JarvanMocommented, Dec 23, 2017

forgot to publish1.1.4.Now it’s released.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error inflating class com.google.android.exoplayer2.ui ...
Seems it's a known issue, which the docs say you should use this (found solution here) : compileOptions { targetCompatibility JavaVersion.
Read more >
Error inflating class com.google.android.exoplayer2.ui ...
I am currently using latest version of ExoPlayer that is 2.10.5, i got the following exception on production environment android.view.
Read more >
Error inflating class com google android exoplayer2 - YouTube
Subscribe My channel to get more Updated Videos - https://bit.ly/35R1t3JError inflating class com.google.android.exoplayer2. ui.
Read more >
com.google.android.exoplayer2.SimpleExoPlayer Java Exaples
This page shows Java code examples of com.google.android.exoplayer2.SimpleExoPlayer.
Read more >
Error inflating class com.google.android.exoplayer2.ui ...
InflateException: Binary XML file line #30: Binary XML file line #30: Error inflating class com.google.android.exoplayer2.ui.PlayerView
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found