-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Gradle build fails with Android Studio Flamingo update #5208
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
Comments
Thanks! The best thing to do would be to send a pull request (or equivalent) to the library's source repository, and use that fork until the pull request gets merged. |
@nicolas-raoul The library is not included as a dependency in the commons app project gradle files, rather the entire codebase of the library has been copied into the data-client folder & the folder is included as a project in the commons app build.gradle file. implementation project(':wikimedia-data-client') And the path for the project is specified in settings.gradle file of commons app project project(':wikimedia-data-client').projectDir = new File('data-client') So it'd be of no use even if a pull request to the library repository fixes the said error unless the library is included as a dependency in build.gradle file of the commons app project, rather than having the entire codebase copied into it. The library repository seems to have got some updates compared to the code present in the commons app project but has not received any updates after November 2019. Actually, this error should have been reported in the wikimedia-android-data-client GitHub repository as it is concerned with publishing of the library and has nothing to do with the commons app itself. The best thing we could do to fix this quickly is to fix it ourselves within this project. I will try, but I suggest this issue be assigned to someone with good knowledge of gradle & publishing libraries. I'm leaving links to resources I found that'd be helpful in solving this issue: If there's no compelling reason to have the entire library within the commons app project, I highly suggest using the library as a dependency rather than having the entire codebase inside this project to avoid such errors in the future. |
After contacting the author of the library, it is clear that it does not have active development. The author has just archived the repository. He told that the library is outdated and suggested commons app gradually move to its own solution with modern tools and practices. I'm working on a temporary solution to just make it work for now. |
Thanks Siva! Even though the long-term solution is probably migration (per #5165), a short-time fix seems needed too, if I understand correctly. |
You're right Nicolas. People are going to update their Android Studio as usual & the build will fail, affecting further development. I'm working on a temporary solution now. Update I was fixing various build errors after upgrading Gradle to 7.5 and AGP to 7.4.2 until I faced an error for which @madhurgupta10 has raised an issue in the Google issue tracker. This comment on that issue suggests that the problem is likely to be fixed in AGP version 8.0 which requires a minimum Gradle version of 8.0. But upgrading to Gradle 8.0 and AGP 8.0 is likely to take some time as there is quite some work to do in the build configuration. I'm trying to get this fixed ASAP. |
I've successfully upgraded AGP and Gradle to the latest version (AGP 8.0.0, Gradle 8.0) but the error still persists. This comment in a similar issue suggests a potential fix. I've asked a question in stack overflow hoping for an answer. |
@nicolas-raoul Can you review my pull request? |
Is this fixed? |
Merging this pull request should solve the issue. |
Summary
Gradle build fails after updating to the latest Android Studio stable release (Flamingo)
Why does it fail?
Android studio Flamingo comes bundled with JDK 17. The minimum Gradle version to support JDK 17 is Gradle 7.3. But the project currently uses Gradle 6.9.
After upgrading Gradle from 6.9 to 7.3, the build still fails with the following error.
This is caused due to error in the build.gradle file of the data-client ie: wikimedia-android-data-client library, rather than the build.gradle of the commons app.
Steps to reproduce
Expected behaviour
The build error is expected as the Gradle version is incompatible with the JDK version.
Actual behaviour
NA
Device name
Realme 3 pro
Android version
Android 11
Commons app version
4.0.3-debug
Device logs
No response
Screen-shots
No response
Would you like to work on the issue?
Yes
The text was updated successfully, but these errors were encountered: