Android Studio Setup
This guide walks you through setting up Android Studio for Bagisto Native Android development.
Prerequisites
Before starting, ensure you have:
- Java Development Kit (JDK) 17+
- Android Studio (Electric Eel or later)
- Android SDK with required components
- Git for version control
Installation Steps
1. Install Android Studio
Download from: https://developer.android.com/studio
bash
# Or via Homebrew
brew install --cask android-studio2. Install Required SDK Components
Open Android Studio → Tools → SDK Manager
Install these components:
- Android SDK Platform (API 34)
- Android SDK Build-Tools (34.0.0)
- Android SDK Platform-Tools
- Android Emulator
3. Configure Environment Variables
Add to your ~/.zshrc or ~/.bashrc:
bash
export ANDROID_HOME=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/platform-tools:$ANDROID_HOME/cmdline-tools/latest/bin4. Clone the Repository
bash
git clone https://github.com/SocialMobikul/BagistoNative_Android.git
cd BagistoNative_AndroidOpening the Project
Method 1: From Android Studio
- Open Android Studio
- Select Open
- Navigate to
BagistoNative_Android/ - Click OK
Method 2: Command Line
bash
# Open directly in Android Studio
open BagistoNative_AndroidProject Sync
After opening, Android Studio will:
- Index files - Building symbol table
- Download dependencies - Gradle sync
- Build shell project - Verify configuration
Watch the bottom status bar for progress.
Common Setup Issues
Issue: Gradle Sync Failed
Solution:
- Check internet connection
- Verify Gradle version in
gradle/wrapper/gradle-wrapper.properties - Try: File → Sync Project with Gradle Files
Issue: SDK Location Not Found
Solution:
- File → Project Structure → SDK Location
- Set Android SDK path
Issue: Java Version Mismatch
Solution:
bash
# Check Java version
java -version
# Should show: openjdk version "17.x.x"Issue: Missing Platform/Build Tools
Solution:
- Open SDK Manager
- Install missing components
Running the App
1. Create Emulator
- Tools → Device Manager
- Click Create Device
- Select device (Pixel 7 recommended)
- Select system image (API 34)
- Click Finish
2. Run the App
- Select your device/emulator from toolbar
- Click Run (▶️) or press
Shift + F10
Debugging
Enable Debug Mode
In app/build.gradle.kts:
kotlin
buildTypes {
debug {
isDebuggable = true
}
}Logcat
Filter by app package:
tag:BagistoNativeChrome DevTools
Enable in WebView:
kotlin
WebView.setWebContentsDebuggingEnabled(true)Then open chrome://inspect in Chrome desktop.
Build Variants
| Variant | Purpose | URL |
|---|---|---|
| Debug | Development | localhost:3000 |
| Release | Production | your-domain.com |
Switching Variants
- Build → Select Build Variant
- Or toolbar dropdown
Tips
- Use Instant Run for faster development
- Enable Jetifier for older dependencies
- Use R8 for release builds to reduce APK size
- Set up proguard-rules.pro for obfuscation
