codelab-exoplayer-intro
codelab-exoplayer-intro copied to clipboard
Codelab seems really outdated and doesn't build out of the box.
A fresh clone of the repository and subsequent building results in the following error:
* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin 'com.android.internal.version-check'.
> Minimum supported Gradle version is 7.0.2. Current version is 6.8. If using the gradle wrapper, try editing the distributionUrl in /Users/.../AndroidStudioProjects/exoplayer-intro/gradle/wrapper/gradle-wrapper.properties to gradle-7.0.2-all.zip
Going into Project Structure and setting the gradle version to something above 7.0.2 does fix the problem. I was able to get it to build by creating a gradle/wrapper directory and adding a gradle-wrapper.properties file with the following content:
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Next I was getting the following error: "This version only understands SDK XML versions up to 2 but an SDK XML file of version 3 was encountered." This I fixed by removing the buildToolsVersion field from the common.gradle file.
Lastly, the ExoPlayer dependencies weren't resolving. This I fixed by adding jcenter() as a repository to allprojects.
Even with this, I'm still getting some warnings that there are references to both AndroidX and the old support library. However, following the above steps, I was able to follow the codelab and run it successfully.
I am having so many problems as well. Every step I follow as in the instructions I get an error. Very bad. Such a gigantic company and cant even get their examples right.