FIRST-Tech-Challenge/FtcRobotController

incorrect gradle classpath version in build.gradle

Closed this issue · 6 comments

in the build.gradle file, it uses gradle classpath 7.2.0 which will cause an error in new Android studio installs. I did create a pull request, however, to fix this change this line:

classpath 'com.android.tools.build:gradle:7.2.0'

to this:

classpath 'com.android.tools.build:gradle:7.4.0'

Thanks!

see the discussion for #1028

The solution is to downgrade the Gradle JDK.

If by new Android Studio you mean Ladybug, the recommended fix is to revert to the Java 17 JDK.

Also discussed here: https://ftc-community.firstinspires.org/t/unable-to-connect-to-control-hub-in-android-studio-ladybug/1132/3

And yeah, I realize Java JDK is redundant :-) I don't know whether it's a JetBrains or Google thing, but labeling that the Gradle JDK, to me, makes me think it's a Gradle thing and not a Java thing when it's actually a Java thing. The actual solution is to get Java 17, which is completely independent of Gradle. Gradle depends upon Java, Java does not depend upon Gradle. Ok. Enough terminology ranting.

Hello, we were recently at meet 0 and saw other, especially new teams, having this issue. If JDK 17 is required I think it would be worthwile to have a note at the top of the read me section as an indication. I agree that downgrading the JDK works, however, I believe that changing it to 7.4.0 would provide an easier fix for less experienced members.

I figured out the full set of things needed to fix building with newer Android Studio versions:

https://gist.github.com/qwertychouskie/1a9ac65f99453a27a6ae19bd969de7d0

While there is still work to do to move away from deprecated features/functionality, this gets things building again and generally functional. Ideally Gradle could be upgraded all the way to 8.9 and com.android.tools.build:gradle to 8.7.1, but I have not yet tested that, as I wanted a more conservative upgrade to start with to get the FTC SDK building again for people as soon as possible.

(Based on FTCTeam10298/2023-24-code@4ed572c, thanks @stupenrose for figuring out a bunch of this last season)

If by new Android Studio you mean Ladybug, the recommended fix is to revert to the Java 17 JDK...

I hate ladybugs, although farmers love them because they are an effective non-chemical pesticide. In any event, why would anyone have "bug" in the name their software product. That seems @lizlooney to me.

Addressed in 10.1.1