Search code examples
flutterazure-devops

what is the correct way or version to add flutter extension to azure devops


I've tested two extensions: sheep24 (flutter tasks) and flutter, the most downloaded ones.

the first gimme in flutter build task: 'outdated dependencies'

the other gimme in flutter build task: 'The current Dart SDK version is 2.13.1.'

so the two fails on build.

thanks.


Solution

  • I use the sheep24 extensions to install flutter. Then I use command line to build.

    For the outdated dependencies error maybe you forget to run flutter pub get before build.

    Simplified tasks for android build:

    - task: FlutterInstall@0
      displayName: Install flutter SDK
      inputs:
        mode: "auto"
        channel: "stable"
        version: "latest"
    - task: CmdLine@2
        displayName: Accept all android licenses
        inputs:
          script: |
            echo "y" | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses
    - task: JavaToolInstaller@0
      inputs:
         versionSpec: 17
         jdkArchitectureOption: "x64"
         jdkSourceOption: "PreInstalled"
    
    ## Keystore download and signin config
    
    - task: CmdLine@2
      displayName: Setup
      inputs:
        script: |
          flutter pub get
    - task: CmdLine@2
      displayName: Build Android
      inputs:
        script: |
          flutter build appbundle