-
Notifications
You must be signed in to change notification settings - Fork 2
Building‐from‐Source
Complete guide to building D.A.V.I.D AI from source code
- Prerequisites
- Environment Setup
- Clone Repository
- Android Studio Setup
- Build Configuration
- Building the App
- Running on Device
- Troubleshooting
Hardware:
- 8GB RAM minimum (16GB recommended)
- 10GB free disk space
- Intel i5 or equivalent processor
Operating System:
- Windows 10/11 (64-bit)
- macOS 10.15 (Catalina) or later
- Linux (Ubuntu 20.04+ or equivalent)
Install JDK 17:
# macOS (using Homebrew)
brew install openjdk@17
# Ubuntu/Debian
sudo apt-get update
sudo apt-get install openjdk-17-jdk
# Verify installation
java -version
# Should show: openjdk version "17.x.x"Windows:
- Download from Adoptium
- Install and add to PATH
# macOS
brew install git
# Ubuntu/Debian
sudo apt-get install git
# Windows
# Download from https://git-scm.com/download/win
# Verify
git --versionDownload and Install:
- Visit Android Studio Download
- Download latest stable version (Hedgehog 2023.1.1+)
- Install with default settings
Required Components:
- Android SDK Platform 34 (Android 14)
- Android SDK Platform 26 (Android 8.0)
- Android SDK Build-Tools 34.0.0
- Android SDK Platform-Tools
- Android Emulator
- NDK (Side by side)
- CMake
- Open Android Studio
- Go to
Settings/Preferences → Languages & Frameworks → Android SDK -
SDK Platforms tab:
- ✅ Android 14.0 (API 34)
- ✅ Android 8.0 (API 26)
-
SDK Tools tab:
- ✅ Android SDK Build-Tools 34.0.0
- ✅ NDK (Side by side)
- ✅ CMake
- ✅ Android Emulator
- Click Apply and wait for downloads
Linux/macOS:
Add to ~/.bashrc or ~/.zshrc:
export ANDROID_HOME=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
# Apply changes
source ~/.bashrc # or ~/.zshrcWindows:
- Open System Properties → Environment Variables
- Add new User Variable:
- Variable:
ANDROID_HOME - Value:
C:\Users\YourUsername\AppData\Local\Android\Sdk
- Variable:
- Edit PATH and add:
%ANDROID_HOME%\platform-tools%ANDROID_HOME%\tools
# Clone the repository
git clone https://github.com/david0154/david-ai.git
# Navigate to directory
cd david-ai
# Check current branch
git branch# Clone via SSH
git clone git@github.com:david0154/david-ai.git
cd david-ai# Check repository status
git status
# View remote
git remote -v
# List files
ls -la- Launch Android Studio
- Click Open (or File → Open)
- Navigate to
david-aifolder - Click OK
First-time sync:
- Android Studio automatically starts Gradle sync
- Progress shown at bottom of window
- Takes 5-10 minutes (downloading dependencies)
- Wait for "BUILD SUCCESSFUL" message
If sync fails:
# Clean Gradle cache
./gradlew clean
# Sync again
./gradlew --refresh-dependencies- Go to
Settings → Build, Execution, Deployment → Build Tools → Gradle -
Gradle JDK: Select
JDK 17orEmbedded JDK 17 - Click Apply
Debug Build:
- For development and testing
- Includes debug symbols
- Not optimized
- Larger APK size
Release Build:
- For production
- Optimized and minified
- Requires signing key
- Smaller APK size
- Open Build Variants panel (bottom left)
- Select:
-
debugfor development -
releasefor production
-
Using Android Studio:
- Menu:
Build → Build Bundle(s) / APK(s) → Build APK(s) - Wait for build to complete
- Click locate in notification
Using Command Line:
# Clean previous builds
./gradlew clean
# Build debug APK
./gradlew assembleDebug
# Output location:
# app/build/outputs/apk/debug/app-debug.apkGenerate Signing Key (First Time):
# Create keystore directory
mkdir -p app/keystore
# Generate keystore
keytool -genkey -v -keystore app/keystore/david_keystore.jks \
-keyalg RSA -keysize 2048 -validity 10000 \
-alias david-release-key
# Follow prompts:
# - Enter keystore password
# - Re-enter password
# - Enter your details
# - Enter key passwordConfigure Signing:
Create keystore.properties in project root:
storePassword=YOUR_KEYSTORE_PASSWORD
keyPassword=YOUR_KEY_PASSWORD
keyAlias=david-release-key
storeFile=keystore/david_keystore.jks.gitignore:
echo "keystore.properties" >> .gitignore
echo "app/keystore/*.jks" >> .gitignoreBuild Release:
# Set environment variables
export KEYSTORE_PASSWORD="your_password"
export KEY_PASSWORD="your_password"
# Build release APK
./gradlew assembleRelease
# Output:
# app/build/outputs/apk/release/app-release.apkFor Google Play Store:
# Build release bundle
./gradlew bundleRelease
# Output:
# app/build/outputs/bundle/release/app-release.aabCreate Emulator:
- Open Device Manager (
Tools → Device Manager) - Click Create Device
- Select:
- Phone: Pixel 6 Pro
- System Image: Android 14 (API 34) with Google Play
- AVD Name: D.A.V.I.D_AI_Emulator
-
Advanced Settings:
- RAM: 4096 MB
- Internal Storage: 8192 MB
- Graphics: Hardware - GLES 2.0
- Click Finish
Run on Emulator:
# List available emulators
emulator -list-avds
# Start emulator
emulator -avd D.A.V.I.D_AI_Emulator -memory 4096 -gpu on &
# Install and run
./gradlew installDebug
adb shell am start -n com.nexuzy.david/.MainActivityEnable Developer Mode:
- Go to Settings → About Phone
- Tap Build Number 7 times
- Developer mode enabled!
Enable USB Debugging:
- Go to Settings → Developer Options
- Enable USB Debugging
- Enable Install via USB
Connect and Run:
# Connect device via USB
# Check device connection
adb devices
# Should show: <device-id> device
# Install debug APK
adb install app/build/outputs/apk/debug/app-debug.apk
# Or use Gradle
./gradlew installDebug
# Launch app
adb shell am start -n com.nexuzy.david/.MainActivity# Clean build
./gradlew clean
# Build debug APK
./gradlew assembleDebug
# Build release APK
./gradlew assembleRelease
# Build debug AAB
./gradlew bundleDebug
# Build release AAB
./gradlew bundleRelease
# Install debug on device
./gradlew installDebug
# Uninstall from device
./gradlew uninstallDebug
# Run unit tests
./gradlew test
# Run instrumented tests
./gradlew connectedAndroidTest
# Generate lint report
./gradlew lint
# Check dependencies
./gradlew dependencies
# List all tasks
./gradlew tasks# Build with stacktrace
./gradlew assembleDebug --stacktrace
# Build with info logging
./gradlew assembleDebug --info
# Build with debug logging
./gradlew assembleDebug --debug
# Build offline (no internet)
./gradlew assembleDebug --offline
# Refresh dependencies
./gradlew assembleDebug --refresh-dependencies
# Build with parallel execution
./gradlew assembleDebug --parallelProblem: Gradle sync fails with dependency errors
Solution:
# Clear Gradle cache
rm -rf ~/.gradle/caches/
# Delete build folders
rm -rf build app/build
# Re-sync
./gradlew clean
./gradlew --refresh-dependenciesProblem: OutOfMemoryError during build
Solution:
Edit gradle.properties:
org.gradle.jvmargs=-Xmx8192m -XX:MaxMetaspaceSize=512m
org.gradle.parallel=true
org.gradle.caching=true
org.gradle.configureondemand=trueProblem: SDK location not found
Solution:
Create local.properties:
# macOS/Linux
sdk.dir=/Users/YOUR_USERNAME/Library/Android/sdk
# Windows
sdk.dir=C:\\Users\\YOUR_USERNAME\\AppData\\Local\\Android\\SdkProblem: adb devices shows no devices
Solution:
# Restart adb server
adb kill-server
adb start-server
# Check device again
adb devices
# macOS: Check System Preferences → Security
# Windows: Install device driversSolution:
-
Enable Gradle Daemon:
# gradle.properties org.gradle.daemon=true org.gradle.parallel=true org.gradle.caching=true
-
Increase Heap Size:
org.gradle.jvmargs=-Xmx8192m -
Use Build Cache:
./gradlew assembleDebug --build-cache
gradle.properties:
# Use parallel execution
org.gradle.parallel=true
# Enable caching
org.gradle.caching=true
# Configure on demand
org.gradle.configureondemand=true
# Increase heap
org.gradle.jvmargs=-Xmx8192m -XX:MaxMetaspaceSize=512m
# Enable Kotlin incremental compilation
kotlin.incremental=true
# Use AndroidX
android.useAndroidX=true
android.enableJetifier=trueapp/build.gradle.kts:
android {
buildTypes {
release {
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
}- ✅ Build successful
- 📱 Install on device
- 🧪 Test all features
- 🐛 Report any issues
- 🤝 Contribute improvements
Need Help?
- 📧 Email: david@nexuzy.in
- 🐛 Report Issue
- 💬 Discussions
© 2026 Nexuzy Tech Ltd.
D.A.V.I.D AI - Digital Assistant with Voice & Intelligent Decisions
Developed by Nexuzy Tech Ltd.
🌐 GitHub • 📧 Support • 🐛 Report Bug • ✨ Request Feature • 💬 Discussions
We do not collect any data.
All processing happens locally on your device.
Supporting 15 languages including all major Indian languages.
© 2026 Nexuzy Tech Ltd. All rights reserved.
Privacy-First AI • Your Device, Your Data • No Data Collection