Skip to main content

Prerequisites

  • Android Gradle Plugin and Kotlin versions supported by your Flutter template
  • minSdk 26 and compileSdk 34 (required for AIR Kit)
Create or edit android/app/src/main/res/values/strings.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="asset_statements" translatable="false">
        [
        {"include": "https://account.air3.com/.well-known/assetlinks.json"},
        {"include": "https://account.sandbox.air3.com/.well-known/assetlinks.json"}
        ]
    </string>
</resources>
Reference the resource from AndroidManifest.xml inside <application>:
<meta-data
    android:name="asset_statements"
    android:resource="@string/asset_statements" />

App signing and allowlisting

Provide your app’s SHA-256 signing certificate fingerprint and package name to Moca for allowlisting (debug and release may differ). Use keytool:
keytool -list -v -keystore <path-to-keystore> -alias <alias>

minSdk and compileSdk

In your app-level Gradle file (Kotlin DSL or Groovy), set at least:
android {
    compileSdk = 34
    defaultConfig {
        minSdk = 26
    }
}

Network security config

Optional: add android/app/src/main/res/xml/network_security_config.xml for TLS and (if needed) local dev domains:
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <base-config cleartextTrafficPermitted="false">
        <trust-anchors>
            <certificates src="system" />
        </trust-anchors>
    </base-config>
    <domain-config cleartextTrafficPermitted="true">
        <domain includeSubdomains="true">10.0.2.2</domain>
    </domain-config>
</network-security-config>
Point <application> to it:
android:networkSecurityConfig="@xml/network_security_config"

Permissions

Typical requirements:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

ProGuard / R8

If you minify release builds, add keep rules for AIR Kit, WebView, and crypto dependencies. Verify package names against your resolved dependencies after flutter pub get:
-keepattributes Signature,*Annotation*,EnclosingMethod,InnerClasses
# Adjust package patterns to match your app’s dependencies
-keep class com.google.android.gms.** { *; }
-dontwarn com.google.android.gms.**

Verify the build

flutter clean
flutter pub get
flutter build apk

Troubleshooting

IssueWhat to check
Passkey / domain errorsAsset statements JSON, signing cert vs allowlist, meta-data wiring
WebView blank / SSLnetworkSecurityConfig, INTERNET permission
Gradle conflictsflutter clean, ./gradlew clean under android/
More help: Flutter troubleshooting and SDK issues.

Next steps

Reference