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:
implementation 'com.google.android.exoplayer:exoplayer:2.6.1' in the build.gradle file for the application module.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?
That sounds odd indeed. Since you haven't changed the ExoPlayer version it seems to me that it can't be a problem caused by ExoPlayer as there is no change of it.
Did you change something else like updated Android Studio or Gradle Version of you project?
What versions of Android Studio and gradle are you using?
In general I'd recommend to use the most recent version of everything, like ExoPlayer, Android Studio and Gradle.
Thanks for your response. After further investigation, I found that the issue appears to be caused by an incompatibility with Gradle. The error went away after I downgraded back to an earlier Gradle version.
For the record, later ExoPlayer versions don't seem to have this problem.
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!
I'm facing the exact same issue as @voghDev and couldn't find any solution other than downgrading Gradle version
@ixfd64 could you please provide some extra information such as the versions of Gradle, gradle-wrapper, Android Studio you're using, so @marcbaechinger or anyone who is reviewing this can do a deeper research? :) thx
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)