Skip to content

Commit c161438

Browse files
committed
Completely describe Ladybug configuration
1 parent 97dfe9c commit c161438

File tree

5 files changed

+69
-11
lines changed

5 files changed

+69
-11
lines changed

docs/source/programming_resources/tutorial_specific/android_studio/installing_android_studio/Installing-Android-Studio.rst

Lines changed: 69 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,6 @@ to verify that your system satisfies the list of minimum requirements:
2424
* `MacOS <https://developer.android.com/codelabs/basic-android-kotlin-compose-install-android-studio#3>`__
2525
* `Linux <https://developer.android.com/codelabs/basic-android-kotlin-compose-install-android-studio#5>`__
2626

27-
Java Development Kit
28-
~~~~~~~~~~~~~~~~~~~~
29-
30-
Earlier versions of Android Studio required that the user install the
31-
Java Development Kit software separately. Versions of Android
32-
Studio up to, and including, Koala incorporate a compatible JDK (Java Development Kit)
33-
as part of the entire install package. It is not necessary, or recommended,
34-
to install the Java Development Kit separately if you are using an Android Studio
35-
version between Chipmunk and Koala. Instead, it is recommended that you
36-
use the Java Development Kit that is included with Android Studio.
3727

3828
.. caution::
3929

@@ -46,7 +36,7 @@ use the Java Development Kit that is included with Android Studio.
4636
an error will be displayed during the Gradle sync and Android Studio will recommend that
4737
you upgrade Gradle. Do not upgrade Gradle.
4838

49-
For more detailed instructions see: https://ftc-community.firstinspires.org/t/unable-to-connect-to-control-hub-in-android-studio-ladybug/1132/3
39+
For more detailed instructions see: Configuring
5040

5141

5242

@@ -80,3 +70,71 @@ Once the setup package has downloaded, launch the application and follow
8070
the on-screen instructions to install Android Studio.
8171

8272

73+
Configuring Android Studio (Ladybug and later)
74+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
75+
76+
See the Caution above for why this is necessary.
77+
78+
Android Studio Ladybug updates the underlying JetBrains IntelliJ version such that
79+
the interface is a VSCode look alike. The screenshots in this documentation use the
80+
JetBrains/Android Studio Classic UI which is no longer supported natively by JetBrains.
81+
To follow along, users should install the `Classic UI <https://plugins.jetbrains.com/plugin/24468-classic-ui>`__ plugin.
82+
83+
#. `Install JDK 17 <https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html>`__
84+
If you did not already have this installed independently of Android Studio.
85+
e.g. If you were using Android Studio’s bundled JDK, then when Ladybug is installed Android Studio
86+
will unhelpfully overwrite your old bundled JDK version. Note there’s a bug in the Settings → Build Tools → Gradle dialog
87+
that may make you think your old version of the JDK is there, but it is not. You must use an unbundled version of the JDK.
88+
89+
#. Go to File -> Settings and under Build, Execution, Deployment -> Build Tools -> Gradle use the Add JDK from disk option
90+
to select the newly installed JDK 17. In the image below take careful note of the directory paths
91+
for the options labelled jbr-17 and jbr-21. Note that they are the same. This is the aforementioned UI bug,
92+
and that is Android Studio overwriting your old JDK. In this image you’ll see I’ve selected the JDK that
93+
was installed independently.
94+
95+
.. image:: images/AndroidStudioSelectJdk.png
96+
:align: center
97+
98+
|
99+
100+
Do Not Upgrade Gradle
101+
~~~~~~~~~~~~~~~~~~~~~
102+
103+
If you have upgraded Android Studio from an earlier version to Ladybug, or you did not install and
104+
configure the JDK prior to loading a FtcRobotController workspace, then Android Studio may present an
105+
error and recommend that you upgrade Gradle.
106+
107+
.. image:: images/AndroidStudioUpgradeGradle.png
108+
:align: center
109+
110+
|
111+
112+
Do not do this. The FtcRobotController build is incompatible with upgraded Gradle. If you do, you
113+
will presented with another, even more, indecipherable error.
114+
115+
To recover, you need to rollback the changes that Android Studio made upon that click.
116+
To do that select Git -> Uncommitted Changes -> Show Shelf
117+
118+
.. image:: images/AndroidStudioRecoverUpgrade.png
119+
:align: center
120+
121+
|
122+
123+
That will show the changes you have in your workspace. You want to rollback the 4 gradle files shown in the
124+
following image. You can either select the Changes checkbox to select all files, or individually select the
125+
gradle files. Note that if you have changes in your workspace that haven’t been committed, you want to be
126+
careful not to select those files or you may lose work.
127+
128+
.. image:: images/AndroidStudioRollback.png
129+
:align: center
130+
131+
|
132+
133+
Once you have the proper files selected, click the Rollback button.
134+
135+
Resync and that should revert you to the error that prompted you to upgrade Gradle in the first place.
136+
From there follow the instructions above to install JDK 17.
137+
138+
139+
140+
Loading
242 KB
Loading
60.8 KB
Loading
21.9 KB
Loading

0 commit comments

Comments
 (0)