FIRST-Tech-Challenge / FtcRobotController

BSD 3-Clause Clear License
829 stars 5.02k forks source link

incorrect gradle classpath version in build.gradle #1174

Open daviied opened 3 days ago

daviied commented 3 days ago

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!

Froze-N-Milk commented 3 days ago

see the discussion for https://github.com/FIRST-Tech-Challenge/FtcRobotController/issues/1028

The solution is to downgrade the Gradle JDK.

cmacfarl commented 3 days ago

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.

daviied commented 3 days ago

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.

qwertychouskie commented 2 days ago

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 https://github.com/FTCTeam10298/2023-24-code/commit/4ed572c77f2049ff71419e3d6324c92214842c1f, thanks @stupenrose for figuring out a bunch of this last season)

AlecHub commented 4 hours ago

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.