How to install Android Studio on Fedora 34

To Install Android Studio on Fedora 34

Introduction:

Android SDK is the Android emulator developed by Google and it implements the API libraries and developer tools required for building, testing, and debug apps for Android on Linux systems. It's also possible to install Android Emulator using Genymotion Android Emulator instead of the Android Emulator.

Installation Procedure:

Step 1: Check the Fedora version by using the following command

[root@linuxhelp ~]# cat /etc/os-release
NAME=Fedora
VERSION="34 (Workstation Edition)"
ID=fedora
VERSION_ID=34
VERSION_CODENAME=""
PLATFORM_ID="platform:f34"
PRETTY_NAME="Fedora 34 (Workstation Edition)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:34"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/34/system-administrators-guide/"
SUPPORT_URL="https://fedoraproject.org/wiki/Communicating_and_getting_help"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=34
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=34
PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy"
VARIANT="Workstation Edition"
VARIANT_ID=workstation

Step 2: First ensure that snap is installed and running on your Fedora

 [root@linuxhelp ~]# dnf install snapd
Last metadata expiration check: 0:02:08 ago on Wed 26 Jan 2022 06:28:52 AM IST.
Dependencies resolved.
=================================================================================================================
 Package                              Architecture        Version                     Repository            Size
=================================================================================================================
Installing:
 snapd                                x86_64              2.54.1-1.fc34               updates               14 M
Upgrading:
 selinux-policy                       noarch              34.23-1.fc34                updates               64 k
 selinux-policy-targeted              noarch              34.23-1.fc34                updates              6.3 M
Installing dependencies:
 snap-confine                         x86_64              2.54.1-1.fc34               updates              2.3 M
 snapd-selinux                        noarch              2.54.1-1.fc34               updates              249 k

Transaction Summary
=================================================================================================================
Install  3 Packages
Upgrade  2 Packages

Total download size: 23 M
Is this ok [y/N]: y

(3/5): snap-confine-2.54.1-1.fc34.x86_64.rpm                                     779 kB/s | 2.3 MB     00:02    
(4/5): selinux-policy-targeted-34.23-1.fc34.noarch.rpm                           6.1 MB/s | 6.3 MB     00:01    
(5/5): snapd-2.54.1-1.fc34.x86_64.rpm                                            3.2 MB/s |  14 MB     00:04    
-----------------------------------------------------------------------------------------------------------------
Total                                                                            4.3 MB/s |  23 MB     00:05     
Running transaction check
Transaction check succeeded.
Running transaction test
  Verifying        : selinux-policy-targeted-34.23-1.fc34.noarch                                             6/7 
  Verifying        : selinux-policy-targeted-34-1.fc34.noarch                                                7/7 

Upgraded:
  selinux-policy-34.23-1.fc34.noarch                 selinux-policy-targeted-34.23-1.fc34.noarch                
Installed:
  snap-confine-2.54.1-1.fc34.x86_64      snapd-2.54.1-1.fc34.x86_64      snapd-selinux-2.54.1-1.fc34.noarch     

Complete!

Step 3: Once installed, start and enable snap.

 [root@linuxhelp ~]# systemctl enable --now snapd.socket

Step 4: Enable classic snap support.

 [root@linuxhelp ~]# ln -s /var/lib/snapd/snap /snap

Step 5: Install Android Studio on Fedora.

 [root@linuxhelp ~]# snap install android-studio --classic
2022-01-26T06:35:05+05:30 INFO Waiting for automatic snapd restart...
android-studio 2020.3.1.24 from Snapcrafters installed

Step 6: Run Android Studio by using following command

 [root@linuxhelp ~]# android-studio
2022-01-26 06:37:53,424 [  18768]   WARN - Container.ComponentManagerImpl - Do not use constructor injection (requestorClass=com.android.tools.idea.AndroidInitialConfigurator) 
2022-01-26 06:38:06,791 [  32135]   WARN - .diagnostic.PerformanceWatcher - UI was frozen for 8809ms, details saved to /root/.cache/Google/AndroidStudio2020.3/log/threadDumps-freeze-20220126-063802-AI-203.7717.56.2031.7678000-ClassLoader.defineClass1-8sec 
Jan 26, 2022 6:38:16 AM java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.
2022-01-26 06:38:32,719 [  58063]   WARN - tions.ex.ConfigurableCardPanel - auto-dispose 'Plugins' id=preferences.pluginManager 
2022-01-26 06:38:40,337 [  65681]  ERROR - plication.impl.ApplicationImpl - Assertion failed: Write access is allowed inside write-action only (see com.intellij.openapi.application.Application.runWriteAction()) 
java.lang.Throwable: Assertion failed: Write access is allowed inside write-action only (see com.intellij.openapi.application.Application.runWriteAction())
	at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:201)
	at com.intellij.openapi.application.impl.ApplicationImpl.assertWriteAccessAllowed(ApplicationImpl.java:1323)
	at com.android.tools.idea.sdk.IdeSdks.setJdkPath(IdeSdks.java:378)
	at com.android.tools.idea.welcome.wizard.deprecated.InstallComponentsPath.runLongOperation(InstallComponentsPath.java:273)
	at com.android.tools.idea.welcome.wizard.deprecated.ConsolidatedProgressStep.doLongRunningOperation(ConsolidatedProgressStep.java:78)
	at com.android.tools.idea.welcome.wizard.deprecated.ConsolidatedProgressStep.access$000(ConsolidatedProgressStep.java:32)
	at com.android.tools.idea.welcome.wizard.deprecated.ConsolidatedProgressStep$1.run(ConsolidatedProgressStep.java:58)
	at com.android.tools.idea.welcome.wizard.deprecated.FirstRunWizardHost$LongRunningOperationWrapper.run(FirstRunWizardHost.java:459)
	at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:962)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsync$5(CoreProgressManager.java:472)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:235)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:178)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:658)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:610)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:65)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:165)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:235)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
	at java.base/java.lang.Thread.run(Thread.java:834)
2022-01-26 06:38:40,385 [  65729]  ERROR - plication.impl.ApplicationImpl - Android Studio Arctic Fox | 2020.3.1 Patch 2  Build #AI-203.7717.56.2031.7678000 
2022-01-26 06:38:40,429 [  65773]  ERROR - plication.impl.ApplicationImpl - JDK: 11.0.10; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o. 
2022-01-26 06:38:40,432 [  65776]  ERROR - plication.impl.ApplicationImpl - OS: Linux 

Step 6: Now proceed with the configuration, you can import settings for Android studio.

Step 7: Allow Android studio to send usage information to Google.

Step 8: Now start the Android Studio installation process.

Step 9: Here, choose the type of installation. For this guide, I will go for the standard installation.

Step 10: Pick the desired Android studio theme. Step 11: You will be granted a preview of configurations made. If the changes are okay, proceed with the installation. Step 12: Configure the Android Emulator.

Step 13: Click “Finish“, the required components will be downloaded as below. Step 14: Once done, click finish and proceed as below.

Step 15: Your app will be launched.

With this process of installing Android studio on Fedora 34 comes to on end.

FAQ
Q
Is it safe to run an Android emulator?
A
Yes, It is safe to download and run Android emulators to the PC. The source of the emulator determines the safety of the emulator. We can also download the emulator from Google or other trusted sources such as Nox or BlueStacks, you are 100% safe!
Q
How to extract the downloaded package?
A
To extract the downloaded package by making use of the following command. # tar -xvf android-sdk_r24.4.1-linux.tgz
Q
How to download the Android emulator in Fedora?
A
To download the Android emulator in Fedora run the following command # wget http://dl.google.com/android/android-sdk_r24.4.1-linux.tgz
Q
How to install an Android emulator in Fedora?
A
To install an Android emulator in Fedora run the following command: # dnf install libgl1-mesa-dev
Q
What is the Purpose of the Android emulator?
A
An Android SDK is the official Android emulator developed by Google and it provides the API libraries and developer tools necessary to build, test, and debug apps for Android in Linux System.