Open dpcunningham opened 4 years ago
You shouldn't have to remove android studio unless you need disk space. One trick I remember is to always install the JDK, and the JRE will be chained in.
Professionally, I've deployed to devices for VR/Unity/Android, and Android Studio. The Mac made this pretty easy to do!
/opt/
-based Installation...or /var
. I don't really care, as long as it's standard-ish. Ima chose /opt/
When I did my first install, I was expecting a Debian-style apt-get install
cycle. I was disappointed to see I'd have to deal with an old-school tarball. Lowering my expectations, I then prepared for a .deb
file that I could install. Imagine my crestfallen look, as I beheld a tarball that I would just have to splatter somewhere & hope for the best.
And, by the way, the installation instructions were pretty much... shite.
After doing a few more of these old-school installs required for Android builds:
/usr/lib/jvm
(against other multiple JREs/JDKs)
...paired up with a source
-able (chmod +x
) script: /etc/profile.d/java_home.sh
/opt
...paired up with a source
-able (chmod +x
) script: /etc/profile.d/gradle.sh
We will bring the Android Studio installation into line with this approach as follows:
/opt/
/etc/profile.d/android.studio.sh
OK, here's where android.studio.sh
ended up:
$ cat /etc/profile.d/android.studio.sh
# export ANDROID_HOME=/opt/android-studio # This does NOT work. The docs... suck.
# You don't point to where the package is installed.
# You point to where it initially laid down some dirs.
# Seriously? What. The. Flock.
export ANDROID_HOME=/home/dpc/Android/Sdk # This DOES work.
# Noted as deprecated in current build cycle
export ANDROID_SDK_ROOT=/home/dpc/Android/Sdk # This is noted as the new standard in builds...
export PATH=$ANDROID_SDK_ROOT/platform-tools:$PATH
export PATH=$ANDROID_SDK_ROOT/tools:$PATH
export PATH=$ANDROID_SDK_ROOT/bin:$PATH
# export PATH=$ANDROID_HOME/bin:$PATH # Redundant (since ANDROID_HOME = ANDROID_SDK_ROOT).
# export PATH=$ANDROID_HOME:$PATH
$ echo $ANDROID_HOME
/home/dpc/Android/Sdk
$ echo $ANDROID_SDK_ROOT
/home/dpc/Android/Sdk
$ echo $PATH
/home/dpc/.local/bin:/usr/lib/jvm/jdk1.8.0_231/bin:/opt/gradle/bin:/home/dpc/Android/Sdk/bin:/home/dpc/Android/Sdk/tools:/home/dpc/Android/Sdk/platform-tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
Bypassing standard Ubuntu/Debian-style installation methods results in... piss-poor integration.
Let's see what other people recommend:
DDG: install android studio on linux mint
cd android-studio/bin
./studio.sh
sudo snap install android-studio --classic
umake android
ppa:paolorotolo/android-studio
DDG: install android studio on linux mint 19
If you want to launch Android Studio from anywhere using 'studio.sh' on a command line, it is recommended that the system wide path include the
android-studio/bin
.
This is important to avoid the build failures detailed in the issue comment: [Deal with missing Adroid Studio "Build Tools" (SDK Components?)](Deal with missing Adroid Studio "Build Tools" (SDK Components?))
Ridwan's Article: How to Install Android Studio on Linux Mint 19 notes the following very important step for Android Builds:
STEP 2: Configuring SDK Manager Launch Android Studio again if you have not already done so. Notice the 'Configure' on the last line of the screen – click on it and then click on the 'SDK Manager' item (see below). For your information, SDK stands for Software Development Kit.
If you don't you will likely need to deal with build problems outlined below: Deal with missing Adroid Studio "Build Tools" (SDK Components?)
The Android Studio site promises the fastest tools for building apps on every type of Android device.
Whoo Hoo!
Note that there are important prerequisites for the Android Studio install: Java and various JREs.
Per: JRE vs OpenJDK vs Oracle JDK
There seems to be two distinct paths here:
An article that distills the details of the points above is: Installing Using Unofficial PPA, which offers:
Install Java First
Install Android Studio
Remove Android Studio (if it ever comes to that)
Yeah....
All this is massively broken after April 2019 -- details are 'splained below, and in the following issues: