This directory contains a Maven repository with prebuilt Flutter AAR (Android Archive) artifacts. These artifacts are generated from the Flutter SDK module and can be used by Android applications without requiring the Flutter toolchain.
π Hosted on GitHub Pages: https://iamnabink.github.io/flutter-android-sdk-maven-repo
The maven-repo/ directory contains compiled Flutter modules packaged as AAR files, organized in standard Maven repository structure. This repository is hosted on GitHub Pages, making it accessible to any Android project via a simple URL.
Maven repository hosting is a method of distributing Android libraries (AAR files) in a standardized format that Gradle and other build tools can automatically resolve. This example project demonstrates:
When you build a Flutter module with flutter build aar, Flutter generates:
.aar files - The compiled Android Archive containing your Flutter code.pom files - Project Object Model files with dependency metadataThese files are organized in a Maven repository structure:
maven-repo/
βββ <groupId>/<artifactId>/<version>/
βββ <artifactId>-<version>.aar
βββ <artifactId>-<version>.pom
Gradle can then resolve these dependencies automatically when you add the repository URL and dependency declaration.
maven-repo/
βββ dev/
βββ nabrajkhadka/
βββ example/
βββ flutter_module/
βββ flutter_debug/1.0/
βββ flutter_release/1.0/
βββ flutter_profile/1.0/
This repository contains the following artifacts:
dev.nabrajkhadka.example.flutter_moduleflutter_debug (version 1.0) - Debug build variantflutter_release (version 1.0) - Release build variantflutter_profile (version 1.0) - Profile build variantEach artifact includes:
.aar file - The compiled Android Archive.pom file - Project Object Model with dependency metadataAdd the Maven repository to your app/build.gradle or root build.gradle:
Option 1: Use GitHub Pages (Recommended)
repositories {
maven {
// GitHub Pages hosted Maven repository
url 'https://iamnabink.github.io/flutter-android-sdk-maven-repo'
}
// Required: Flutter's Android embedding dependencies
maven {
url 'https://storage.googleapis.com/download.flutter.io'
}
google()
mavenCentral()
}
Option 2: Use Local Repository
If you prefer to use a local copy of the repository:
repositories {
maven {
// Local maven repository containing Flutter AAR artifacts
url '../maven-repo' // Adjust path relative to your project
// Or use absolute path:
// url file('path/to/maven-repo')
}
// Required: Flutter's Android embedding dependencies
maven {
url 'https://storage.googleapis.com/download.flutter.io'
}
google()
mavenCentral()
}
Add the Flutter module dependencies to your app/build.gradle:
dependencies {
// Release build variant
releaseImplementation ('dev.nabrajkhadka.example.flutter_module:flutter_release:1.0@aar') {
transitive = true
}
// Debug build variant
debugImplementation ('dev.nabrajkhadka.example.flutter_module:flutter_debug:1.0@aar') {
transitive = true
}
// Profile build variant (optional)
profileImplementation ('dev.nabrajkhadka.example.flutter_module:flutter_profile:1.0@aar') {
transitive = true
}
// Required: MultiDex support
implementation 'androidx.multidex:multidex:2.0.1'
}
Important Notes:
transitive = true is required to include all SDK dependenciesminSdkVersion is set to 24 or higherAdd Flutter embedding metadata inside the <application> tag:
<meta-data
android:name="flutterEmbedding"
android:value="2" />
The Maven repository follows the standard Maven directory layout:
maven-repo/
βββ <groupId>/
βββ <artifactId>/
βββ <version>/
βββ <artifactId>-<version>.aar
βββ <artifactId>-<version>.pom
Where:
groupId = dev.nabrajkhadka.example.flutter_moduleartifactId = flutter_debug, flutter_release, or flutter_profileversion = 1.0maven {
url 'https://storage.googleapis.com/download.flutter.io'
}
https://iamnabink.github.io/flutter-android-sdk-maven-repomaven-repo is correct in your build.gradle./gradlew build --refresh-dependenciesminSdkVersion to 24 or higher in your build.gradleFrom the flutter_sdk/ directory, build the AAR files:
cd flutter_sdk
flutter pub get
flutter build aar
This generates AAR files in build/host/outputs/repo/ with the standard Maven structure.
Copy the generated repository contents to maven-repo/:
# From project root
cp -r flutter_sdk/build/host/outputs/repo/* maven-repo/
Or manually copy the directory structure:
dev/nabrajkhadka/example/flutter_module/ β maven-repo/dev/nabrajkhadka/example/flutter_module/Ensure the repository follows Maven conventions:
maven-repo/
βββ dev/
βββ nabrajkhadka/
βββ example/
βββ flutter_module/
βββ flutter_debug/
β βββ 1.0/
β βββ flutter_debug-1.0.aar
β βββ flutter_debug-1.0.pom
βββ flutter_release/
β βββ 1.0/
β βββ flutter_release-1.0.aar
β βββ flutter_release-1.0.pom
βββ flutter_profile/
βββ 1.0/
βββ flutter_profile-1.0.aar
βββ flutter_profile-1.0.pom
This repository is configured to be served via GitHub Pages. To set up GitHub Pages for your repository:
maven-repo/ (usually main or master)/maven-repo (or / if maven-repo is in root)https://<username>.github.io/<repo-name>/maven-repohttps://iamnabink.github.io/flutter-android-sdk-maven-repoflutter build aarmaven-repo/ directorymaven-repo/ directoryWhile this example uses GitHub Pages, you can host Maven repositories on:
This directory is:
For local development, you can also use the local path option in your build.gradle.
This Maven repository is part of an example Flutter SDK project that demonstrates:
This example serves as a reference implementation for teams looking to:
When hosting AAR files in a Maven repository:
.pom files correctly list all transitive dependenciesexample_android/app/build.gradle - Example Android project using this repository