You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

求助:搭建Azure DevOps流水线构建部署Android App Bundle至指定平台

Hey there! I’ve been through this exact scenario before—moving from APK to AAB deployments on Azure DevOps can trip you up a bit, but let’s break this down step by step to get your .aab files deployed smoothly to either Google Play or App Center.

Deploying Android App Bundle (.aab) from Azure DevOps

1. Adjust Your Pipeline to Build the AAB

Since you already know how to build APKs, the main change here is switching your Gradle task to generate an AAB instead:

  • In your Azure DevOps Gradle build task, update the Tasks field from assembleRelease to bundleRelease. This tells Gradle to build the app bundle instead of the traditional APK.
  • Double-check your module-level build.gradle to ensure bundle configurations are set up correctly (this is optional but helps optimize your AAB):
    android {
        ...
        bundle {
            // Optional: Disable language splits if you don't need them
            language { enableSplit = false }
            density { enableSplit = true }
            abi { enableSplit = true }
        }
    }
    
  • Verify your release signing config is applied to the bundle task (same as APK, but confirm it’s linked to the release build type):
    signingConfigs {
        release {
            storeFile file('your-keystore.jks')
            storePassword System.getenv('KEYSTORE_PASSWORD')
            keyAlias System.getenv('KEY_ALIAS')
            keyPassword System.getenv('KEY_PASSWORD')
        }
    }
    
    buildTypes {
        release {
            signingConfig signingConfigs.release
            ...
        }
    }
    

2. Deploy to Google Play

To push your AAB directly to Google Play, use the official Google Play Publisher extension:

  • First, install the Google Play Publisher extension from the Azure DevOps Marketplace (search for it in your org’s marketplace).
  • Add the Google Play Publisher task to your pipeline’s deployment stage:
    • Configure the Service Connection: Use a pre-created Google Play service connection (set this up using your Google Play service account key file).
    • Enter your app’s Application ID (the package name you used in your Android project).
    • Under Artifact Type, select Android App Bundle (.aab).
    • Set the Bundle File path to **/app/build/outputs/bundle/release/*.aab (this matches the default Gradle output location).
    • Choose your target Track (e.g., internal, beta, production) and any testing groups if deploying to closed tests.

3. Deploy to App Center

App Center supports AAB distribution, though testers will need to install via Google Play since AABs can’t be directly sideloaded:

  • Install the App Center Distribute extension from the Azure DevOps Marketplace.
  • Add the App Center Distribute task to your pipeline:
    • Configure the Service Connection using your App Center API token.
    • Enter the App Slug in the format {your-app-center-username}/{your-app-name}.
    • Set the Binary File Path to **/*.aab to target your built bundle.
    • Select your target Distribution Group (e.g., internal testers, collaborators).
    • Note for testers: They’ll need to click the App Center link and follow the prompt to install via Google Play—AABs don’t work with direct device installation.

Common Fixes for AAB Deployment Issues

  • AAB file not found: Add a Publish Build Artifacts task after the Gradle build to upload the app/build/outputs/bundle/release directory. This lets you verify the AAB was generated correctly.
  • Signing failures: Ensure your keystore credentials (stored in Azure DevOps variables) are correctly referenced in your Gradle script—double-check variable names and permissions.
  • Google Play authorization errors: Make sure your Google Play service account has the Release Manager or Owner role assigned in the Google Play Console.
  • App Center installation confusion: Communicate to testers that they need to use the Google Play link from App Center—direct AAB installation isn’t supported.

内容的提问来源于stack exchange,提问作者user_1989

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.09 07:42:31