Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check support for Gradle 4.4 #3708

Closed
lintax opened this issue Jan 15, 2018 · 19 comments
Closed

Check support for Gradle 4.4 #3708

lintax opened this issue Jan 15, 2018 · 19 comments
Assignees
Labels

Comments

@lintax
Copy link

lintax commented Jan 15, 2018

Gone through tutorial

  1. I've cloned the repository
  2. Checked out release-v2
  3. Added suggested lines to settings.gradle

Got an error
Error:Cannot create variant 'android-lint' after configuration ':exoplayer-library-core:debugRuntimeElements' has been resolved

@lintax
Copy link
Author

lintax commented Jan 16, 2018

I've checked with old gradle version (4.1) and it worked.
Seems, the current gradle 4.4 is not supported by your build scripts

@AquilesCanta
Copy link
Contributor

We'll keep this open until we confirm ExoPlayer works with gradle 4.4.

@ojw28 ojw28 changed the title Trying to configure ExoPlayer as a module (for ffmpeg build) Check support for Gradle 4.4 Mar 7, 2018
@ojw28
Copy link
Contributor

ojw28 commented Mar 14, 2018

I tried using gradle 4.4 and things seem to work fine with 2.7.1. If you're still seeing issues with 2.7.1, please provide detailed reproduction steps. Thanks!

@ojw28 ojw28 closed this as completed Mar 14, 2018
@AquilesCanta
Copy link
Contributor

This is still an issue, I think.

@AquilesCanta AquilesCanta reopened this Mar 15, 2018
@needz
Copy link

needz commented Mar 27, 2018

Is there a manual way to fix this issue? Or only downgrade Android Studio to previous version?

@lintax
Copy link
Author

lintax commented Mar 27, 2018

@needz there is hardly any connection to Android Studio version. You can just decrease gradle version in gradle-wrapper.properties

@needz
Copy link

needz commented Mar 27, 2018

@lintax, after upgrading to Android Studio 3.1 the minimum required gradle version is 4.4, so I can’t really downgrade it. Already tried.

@lintax
Copy link
Author

lintax commented Mar 27, 2018

@needz yeah, not realized that 3.1 was released already
As a quick-but-not-fast-to-do-fix, I think you can make a separate project to build your exoplayer version with old Android Studio and gradle versions, and depend on already built aar in the main project.
Or yes, revert to previous version.

@bennylaws
Copy link

I just came across the same error - updated AS to 3.1 and my project wouldn't compile anymore.
I replaced AS 3.1 with 3.0.1 and wanted to downgrade the gradle version in gradle wrapper properties, but also in AS 3.0.1 it tells me Gradle 4.4 is the minimum. I believe I had the same config working fine half an hour ago and now I can't compile my project anymore.
(I'm using ExoPlayer 2.7.1 in my project)

Any suggestions?

error: Error:Cannot create variant 'android-lint' after configuration ':exoplayer-library-core:debugRuntimeElements' has been resolved

@function1983
Copy link

Stupid me upgrade Android Studio to 3.1.0.
Redownload to 3.0.1 and it works now. Wait for exoplayer to support 4.4 then upgrade people!

@bennylaws
Copy link

after going back from AS 3.1 to older 3.0.1 and setting
classpath 'com.android.tools.build:gradle:3.1.0'
to
classpath 'com.android.tools.build:gradle:3.0.1'
in top level build.gradle
and setting
distributionUrl=https://services.gradle.org/distributions/gradle-4.4-all.zip
distributionUrl=https://services.gradle.org/distributions/gradle-4.1-all.zip
in gradle wrapper properties it's working again for me.

(But to be honest I'm not sure whether that's the same I had in there before, feels correct though)

@needz
Copy link

needz commented Mar 27, 2018

Is there an easy way to downgrade to 3.0.1 without full uninstall of 3.1?

@tao1
Copy link

tao1 commented Mar 27, 2018

Here are reproduction steps

git clone https:/google/ExoPlayer.git
cd ExoPlayer
git checkout origin/release-v2
git apply ../Gradle-3.1.0.patch
./gradlew build


> Configure project :demo 
WARNING: The specified Android SDK Build Tools version (26.0.2) is ignored, as it is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.0.
Android SDK Build Tools 27.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '26.0.2'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

> Configure project :demo-cast 
WARNING: The specified Android SDK Build Tools version (26.0.2) is ignored, as it is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.0.
Android SDK Build Tools 27.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '26.0.2'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

> Configure project :demo-ima 
WARNING: The specified Android SDK Build Tools version (26.0.2) is ignored, as it is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.0.
Android SDK Build Tools 27.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '26.0.2'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

> Configure project :library-core 
WARNING: The specified Android SDK Build Tools version (26.0.2) is ignored, as it is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.0.
Android SDK Build Tools 27.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '26.0.2'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

> Configure project :extension-cast 
WARNING: The specified Android SDK Build Tools version (26.0.2) is ignored, as it is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.0.
Android SDK Build Tools 27.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '26.0.2'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.


FAILURE: Build failed with an exception.

* Where:
Script '/home/tao/AndroidStudioProjects/ExoPlayer/javadoc_library.gradle' line: 23

* What went wrong:
A problem occurred configuring project ':extension-cast'.
> Failed to notify project evaluation listener.
   > Could not resolve all dependencies for configuration ':extension-cast:releaseCompileClasspath'.
      > A problem occurred configuring project ':library-core'.
         > Failed to notify project evaluation listener.
            > Cannot create variant 'android-lint' after configuration ':library-core:debugRuntimeElements' has been resolved
            > No such property: FOR_RUNTIME for class: org.gradle.api.attributes.Usage
   > No such property: FOR_RUNTIME for class: org.gradle.api.attributes.Usage

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Here is patch:

From 46d6edf6b76afbd77e7048c094f5a03284345c66 Mon Sep 17 00:00:00 2001
From: Me
Date: Tue, 27 Mar 2018 15:27:12 +0200
Subject: [PATCH] Gradle 3.1.0

---
 build.gradle                             | 2 +-
 gradle/wrapper/gradle-wrapper.properties | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/build.gradle b/build.gradle
index 9f9081a94..313585f0a 100644
--- a/build.gradle
+++ b/build.gradle
@@ -17,7 +17,7 @@ buildscript {
         google()
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:3.0.1'
+        classpath 'com.android.tools.build:gradle:3.1.0'
         classpath 'com.novoda:bintray-release:0.5.0'
     }
     // Workaround for the following test coverage issue. Remove when fixed:
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 32ec7e332..5559e8ccf 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
-- 
2.14.1

@mikal-ustad
Copy link

I'm able to work around this by updating the bintray version to 0.8.0 and removing the classpath lines from javadoc_combined.gradle and javadoc_library.gradle. More explanation here

@ojw28
Copy link
Contributor

ojw28 commented Mar 27, 2018

We have a fix for this that will be pushed to the dev-v2 branch shortly.

@ojw28 ojw28 added the bug label Mar 27, 2018
@ojw28
Copy link
Contributor

ojw28 commented Mar 28, 2018

Fixed in 13592df

@ojw28 ojw28 closed this as completed Mar 28, 2018
@ram992
Copy link

ram992 commented Mar 30, 2018

@ojw28, can you also give an answer on how to solve this with exoplayer v2.2.0 as I am not in a position to upgrade the player yet.

@ojw28
Copy link
Contributor

ojw28 commented Apr 2, 2018

@ram992, unless you're building ExoPlayer from source I don't think this should affect earlier versions. If you are building from source then you could not do that. If you need to build from source because you've forked the library and have custom code in it, then maintaining that branch is your responsibility. You'd need to look at back-porting the fix reference above into your fork.

@ram992
Copy link

ram992 commented Apr 4, 2018

Thanks @ojw28, I was able to fix it. Posting the change here, so that some one else can use, as this is the first link that pops in google

  1. Increase your com.novoda:bintray-release:x.y.z to 0.8.0
  2. Add this code as given by the above reference Fixed in 13592df
    doFirst{
    classpath = files(variant.javaCompile.files,
    project.android.getBootClasspath())
    }
    doLast {
    copy {
    from "src/main/javadoc"
    into "$buildDir/docs/javadoc"
    }
    project.fixJavadoc()
    }
    comment out classpath line that is already there. You have to do it if you are in versions below than 2.4.x as I believe in the next versions, gradle dependency is changed. changes will be in build.gradle file of Exoplayer lib

@google google locked and limited conversation to collaborators Aug 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

9 participants