This comprehensive guide will walk you through installing and configuring Android Studio on Linux specifically for React Native and Expo development. By the end of this guide, you'll have a fully functional development environment optimized for mobile app development.
Prerequisites
Before starting, ensure you have:
Ubuntu/Debian-based Linux distribution
At least 8GB of RAM (16GB recommended)
10GB+ of free disk space
Terminal access with sudo privileges
Basic knowledge of command line operations
Installing Android Studio
Step 1: Update Your System
First, update your package manager and system packages:
bash
1sudo apt update && sudo apt upgrade -y
Step 2: Install Android Studio
We'll use the official PPA repository for the most up-to-date version:
Welcome Screen: Click "Next" to start the setup wizard
Install Type: Choose "Standard" for typical development setup
UI Theme: Select your preferred theme (Darcula or Light)
SDK Components: The wizard will automatically download:
Android SDK
Android SDK Platform
Android Virtual Device (AVD)
Latest Android SDK build-tools
Step 2: Create a Test Project
To verify everything works correctly:
Create a new Kotlin project
Select "Empty Activity" template
Click "Finish" and wait for Gradle sync
Click the "Run" button (green play icon) to test compilation
React Native/Expo Specific Setup
Critical: Fix the Launch Script
This is essential for React Native/Expo projects to work properly with Android Studio.
Why this matters: The default launch script (studio.sh) doesn't load the Node.js environment properly, causing issues with Gradle configurations that use Node.js commands.
Never directly edit the android/ folder in Expo projects
Use Expo Config Plugins for native modifications
Keep custom native modules in separate directories
2. Autolinking Configuration
Only modify autolinking settings if you have specific requirements:
json
1{
2"expo":{
3"name":"your-app-name",
4"autolinking":{
5"searchPaths":["../../packages"],
6"nativeModulesDir":"../../packages"
7}
8}
9}
3. Development Workflow
Use Expo CLI for project creation and management
Test on real devices when possible
Use Android Studio for:
Native code debugging
Performance profiling
Advanced logging
Build analysis
4. Version Management
Keep Android Studio updated
Use specific Android SDK versions for consistency
Document your environment setup in project README
Troubleshooting Checklist
Before asking for help, verify:
[ ] Android Studio launches with the correct script
[ ] Environment variables are set correctly
[ ] Node.js is accessible from Android Studio
[ ] Gradle can execute Node.js commands
[ ] Expo CLI is up to date
[ ] Project dependencies are installed
Conclusion
With Android Studio properly configured on Linux, you now have a powerful development environment for React Native and Expo projects. The key points to remember:
Use the correct launcher to ensure Node.js integration
Set up environment variables properly
Leverage Android Studio's debugging tools for efficient development
Follow Expo best practices for native code modifications
This setup will provide you with professional-grade tools for mobile app development, from initial coding to debugging and performance optimization.