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.

"cannot resolve symbol: util" in ExoPlayer 2.6.1 - previously worked fine

See original GitHub issue

Since a few days ago, our projects that use ExoPlayer 2.6.1 no longer compile. Android Studio now gives a cannot resolve symbol: util error even though they have previously compiled without problems.

Steps to reproduce:

  1. Create a new project in Android Studio.
  2. Add ExoPlayer 2.6.1 as a build dependency by putting implementation 'com.google.android.exoplayer:exoplayer:2.6.1' in the build.gradle file for the application module.
  3. Create a new Java class and import the com.google.android.exoplayer2.util.Util package.

Expected behavior:

Gradle should sync and the app should compile.

Actual behavior:

Android Studio throws up a cannot find symbol: util error. Changing the Gradle import to

implementation 'com.google.android.exoplayer:exoplayer-core:2.6.1'
implementation 'com.google.android.exoplayer:exoplayer-hls:2.6.1'

resolves the problem.

As I mentioned earlier, our projects that use ExoPlayer 2.6.1 previously worked without any issues. The repository shows that ExoPlayer 2.6.1 does have a util folder. Has there been a change in the Gradle package?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ixfd64commented, Jun 24, 2019

I’m using the following versions:

Android Studio 3.4 Gradle plug-in 2.3.3 (downgraded from latest) Gradle 4.1 (downgraded from latest)

1reaction
voghDevcommented, May 29, 2019

I’m having the same error. As @ixfd64 said, I could workaround it by downgrading Gradle Android plugin from 3.4.0 to 3.2.0 and gradle-wrapper.properties from 5.1.1 to 4.10.1. This is the last configuration that worked

build.gradle

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.0'
        // ...
    }
}

gradle-wrapper.properties distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip

app/build.gradle implementation 'com.google.android.exoplayer:exoplayer:r2.5.3'

After downgrading Gradle, exoplayer versions r2.5.2, r2.5.3, r2.5.4 seem to work fine, but none of them works with Gradle 3.4.0 - gradle-wrapper 5.1.1. Has anyone found a way to make it work after upgrading Gradle?

Thanks in advance!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exoplayer 2.17.1 Cannot resolve symbol ExoPlayerFacory ...
I am new to android dev and I am trying to make an app. I want to display a list of videos and...
Read more >
Unable to resolve com.google.android.exoplayer2 after ...
My project is using com.google.android.exoplayer2. Until today I was at gradle 4.10.1 (android gradle plugin 3.3.1) - all fine.
Read more >
Com.Squareup.Retrofit2.Converter-Gson:2.3.0 - ADocLib
Android Studio now gives a cannot resolve symbol: util error even though they Add ExoPlayer 2.6.1 as a build dependency by putting Util...
Read more >
Legal Notices for Astro App on iOS and Android - Amazon.com
If you believe that your work has been copied in a way that constitutes copyright infringement, please provide Amazon's copyright agent the written...
Read more >
Download Diff File - Codeberg
Conversations only introduced the offical backup feature in 2.4.0 after making sure the *OMEMO self healing* mechanism introduced in 2.3.11 works fine.
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