GitHub Actions-powered WebRTC Android AAR Build System
Build WebRTC Android libraries automatically in the cloud using GitHub Actions, eliminating local build complexity and compatibility issues across all platforms.
- βοΈ Zero Local Resources - No local build environment required
- β‘ Cloud Build - Generally saves several hours (varies by hardware/branch)
- π― Flexible WebRTC Versions - Build any WebRTC branch with automatic version detection and latest security patches
- π¦ Ready to Use - Direct AAR file download (includes multi-ABI, may require ProGuard/R8/NDK configuration based on project setup)
- π¬ Slack Integration - Build notifications with results
βββββββββββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β Any Device (Client) βββββΆβ GitHub Actions βββββΆβ Build Result β
β β β β β β
β β’ Windows/macOS/Linux β β β’ Ubuntu Latest β β β’ AAR File β
β β’ Simple Git Push β β β’ depot_tools β β β’ Build Info β
β β’ Zero Local Resources β β β’ WebRTC Source β β β’ Artifacts β
βββββββββββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β
βΌ
βββββββββββββββββββ β
β Slack Notificationβ
β β
β β’ Success/Failure β
β β’ Download Links β
β β’ Build Details β
βββββββββββββββββββ β
1. π Trigger via GitHub Actions Workflow
2. π₯οΈ Setup Ubuntu Latest Cloud Environment
3. π οΈ Install depot_tools & Dependencies
4. π₯ Fetch WebRTC Source (branch-heads/7258 default)
5. βοΈ Configure Build (architectures, release optimized)
6. π¨ Compile AAR (libwebrtc-M{MILESTONE}-{BRANCH}-patched-XX.aar)
7. β
Verify & Package
8. π€ Upload Artifacts for Download
9. π¬ Send Slack Notifications
Why It Works on All Platforms:
- Cloud-Based Build: All compilation happens on GitHub's Ubuntu runners (ubuntu-latest = Ubuntu 24.04 as of Jan 2025) - local systems only trigger workflows and download artifacts
- Local Independence: Your device only triggers the build and downloads results
- No Architecture Conflicts: Eliminates local build environment issues
- Resource Efficient: No local memory, disk, or CPU requirements
- Runner Stability: Consider using
runs-on: ubuntu-24.04for build consistency if package changes cause issues - Build Optimization: Integrated ccache compiler caching and
actions/cachefor optimal build performance and reduced minutes consumption
To use this action in your workflow, add the following step to your .github/workflows/your-workflow.yml file:
- name: Build WebRTC Android AAR
uses: bentleypark/webrtc-android-builder@v1 # Replace with your username/repo and desired tag/branch
with:
webrtc_branch: 'branch-heads/7258' # Default: M139 (Current Stable), Options: branch-heads/7339 (M140 Beta), branch-heads/7258 (M139 Stable), branch-heads/7204 (M138 Stable)
target_arch: 'armeabi-v7a,arm64-v8a' # Default: arm64-v8a,armeabi-v7a
# slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }} # Optional: Uncomment for Slack notifications
# slack_channel: '#build-notifications' # Optional: Uncomment for Slack notifications
# enable_slack_notifications: 'true' # Optional: Uncomment for Slack notifications- Create Slack App and Incoming Webhook in your workspace
- Copy webhook URL and add to GitHub Repository Settings β Secrets β
SLACK_WEBHOOK_URL - Configure channel name in workflow inputs
- GitHub Repository β Actions tab
- Select Build WebRTC Android AAR
- Click Run workflow
- Configure build options:
- WebRTC Branch:
branch-heads/7258(M139, stable) - Target Architectures:
armeabi-v7a,arm64-v8a
- WebRTC Branch:
- Click Run workflow button
- After build completion, check Artifacts section
- Download AAR file (pattern:
libwebrtc-M{MILESTONE}-{BRANCH}-patched-XX.aar, example:libwebrtc-M139-7258-patched-98.aar) - Copy to your Android project's
app/libs/folder
android {
compileSdk 35
defaultConfig {
applicationId "com.yourapp.example"
minSdk 24 // Modern Android support
targetSdk 35
versionCode 1
versionName "1.0"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}
dependencies {
// Method 1: Direct file reference
implementation files('libs/libwebrtc-M{MILESTONE}-{BRANCH}-patched-XX.aar') // example: libwebrtc-M139-7258-patched-98.aar
// Method 2: Using fileTree for multiple AARs
// implementation fileTree(dir: 'libs', include: ['*.aar'])
// Additional dependencies (if needed)
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.10.0'
}# WebRTC library protection (essential rules only)
-keep class org.webrtc.** { *; }
-dontwarn org.webrtc.**
# JNI methods protection
-keepclasseswithmembernames class * {
native <methods>;
}
# Core WebRTC callbacks
-keep class * implements org.webrtc.PeerConnection$Observer { *; }
-keep class * implements org.webrtc.SdpObserver { *; }
This action has the following inputs:
| Input | Description | Default | Required |
|---|---|---|---|
webrtc_branch |
The WebRTC branch to build. Supports branch-heads/XXXX format. Automatically detects milestone version. | branch-heads/7258 |
false |
target_arch |
A comma-separated list of target architectures. | armeabi-v7a,arm64-v8a |
false |
slack_webhook_url |
The Slack webhook URL for sending build notifications. Must be stored as a GitHub secret. | N/A |
false |
slack_channel |
The Slack channel to send notifications to. | #build |
false |
enable_slack_notifications |
Set to true to enable Slack notifications. Requires slack_webhook_url to be set. |
false |
false |
This action produces the following outputs:
| Output | Description |
|---|---|
aar_filename |
The filename of the generated AAR package. Pattern: libwebrtc-M{MILESTONE}-{BRANCH}-patched-XX.aar |
download_url |
The URL to the GitHub Actions run where the build artifacts can be downloaded. |
build_info |
A summary of the build information. |
The action automatically detects the WebRTC milestone version from the branch name and generates dynamic AAR filenames.
Example Branches (refer to Chromium Dash for current mappings):
| Branch | Version | Release Status | AAR Filename Pattern |
|---|---|---|---|
branch-heads/7339 |
M140 | Beta (Next Stable) | libwebrtc-M140-7339-patched-{PATCH}.aar |
branch-heads/7258 |
M139 | Stable (Current) | libwebrtc-M139-7258-patched-{PATCH}.aar |
branch-heads/7204 |
M138 | Stable (Previous) | libwebrtc-M138-7204-patched-{PATCH}.aar |
branch-heads/7151 |
M137 | Stable (LTS) | libwebrtc-M137-7151-patched-{PATCH}.aar |
branch-heads/7103 |
M136 | Legacy | libwebrtc-M136-7103-patched-{PATCH}.aar |
Dynamic Version Detection: The action uses Chromium's Gitiles API to fetch exact version information from each branch's VERSION file, ensuring accurate AAR filenames.
AAR Filename Pattern: libwebrtc-M{MILESTONE}-{BRANCH}-patched-XX.aar
- example:
libwebrtc-M139-7258-patched-98.aar(M139, branch-heads/7258, patch 98)
Need to find the right branch for your target milestone? Check Chromium Dash for official branch-to-milestone mappings and current Chrome release status verification.
Note: The patch number (XX) in AAR filenames is dynamic and automatically detected from the branch's current VERSION file. This ensures you always get the latest patches and security fixes for each milestone.
# All architectures (recommended)
target_arch: "armeabi-v7a,arm64-v8a"
# ARM64 only (modern devices)
target_arch: "arm64-v8a"
# Including x86 (emulator support)
target_arch: "armeabi-v7a,arm64-v8a,x86,x86_64"| Build Environment | Build Time | CPU/Memory | Disk Space | Cost | Platform Compatibility |
|---|---|---|---|---|---|
| GitHub Actions | Under 1 hour | 4 vCPU/16GB | 14GB SSD | Free* | All Platforms β |
| Local Build | 4-8 hours | Varies | 100GB+ | Power | Platform Issues β |
| Jenkins (AWS) | 1.5 hours | Custom | Custom | $30-120/month | All Platforms β |
| Docker Local | 6-10 hours | Varies | 100GB+ | Power | Docker Required |
*Public repositories: unlimited free. Private repositories: 2,000 minutes/month (Free plan), 3,000 minutes/month (Team plan)
π WebRTC Android AAR Build Success!
π Build Information:
β’ Milestone: M140
β’ Branch: branch-heads/7339
β’ Architectures: armeabi-v7a,arm64-v8a
β’ Configuration: release (optimized)
π¦ AAR File: libwebrtc-M{MILESTONE}-{BRANCH}-patched-XX.aar
(example: libwebrtc-M140-7339-patched-15.aar)
π SHA256: a1b2c3d4e5f67890abcdef1234567890abcdef1234567890abcdef1234567890
π [Download Artifacts](link)
β WebRTC Android AAR Build Failed!
π Build Information:
β’ Milestone: M140
β’ Branch: branch-heads/7339
β’ Configuration: release (optimized)
π [Check Build Log](link)
- Check Actions tab for logs
- Common causes:
- Invalid branch name
- Unsupported architecture
- Network timeout
- depot_tools initialization issues
Note: Build failures are independent of your local platform - they occur in the cloud environment, not locally.
# Wrong example
target_arch: "armv7,arm64"
# Correct example
target_arch: "armeabi-v7a,arm64-v8a"- Create Slack App: Go to https://api.slack.com/apps and create new app
- Enable Incoming Webhooks: Activate in Features β Incoming Webhooks
- Add Webhook to Workspace: Choose target channel and copy webhook URL
- Set GitHub Secret: Repository Settings β Secrets and variables β Actions β New repository secret
- Name:
SLACK_WEBHOOK_URL - Value: Your webhook URL
- Name:
- Configure Notifications: Enable in workflow inputs with your channel name
webrtc-android-builder/
βββ .github/
β βββ workflows/
β βββ build-webrtc-android.yml # Build workflow
βββ docs/
β βββ android-integration.md # Complete integration example
βββ scripts/
β βββ download-latest-aar.sh # CLI download script
βββ README.md # This file
βββ LICENSE # License
βββ action.yml # GitHub Action definition
- Submit detailed information via GitHub Issues
- Suggest via Discussions tab
- Follow: Fork β Branch β Commit β PR workflow
- Security Patches: Latest CVE fixes included
- Modern Android: Full Android compatibility
- Secure Build: All builds from official WebRTC source
This Project: Licensed under MIT License
WebRTC: Licensed under BSD-3-Clause License
- Copyright (c) 2011, The WebRTC project authors. All rights reserved.
- Source: webrtc.org
- Additional patent grant: PATENTS
Important: WebRTC includes an additional patent grant that provides protection for users and implementers. The patent grant terminates if patent litigation is instituted against the WebRTC implementation.
If this project helped solve your WebRTC build issues on any platform, please give it a β!
π Built for developers across all platforms - Windows, macOS, and Linux.
Universal solution for WebRTC development challenges.
Need help or have questions? Open an issue! π¬
For detailed integration examples, troubleshooting, and advanced configurations, check out:
- π§ Android Integration Example - Complete code samples
- π₯ AAR Download Script - Automated CLI download