NeoMind
NeoMind

Reputation: 155

Github Actions Flutter CI Error: No version of NDK matched

Project Repository

I've been push the commit

but, I got error

* What went wrong:
Execution failed for task ':app:stripReleaseDebugSymbols'.


> No version of NDK matched the requested version 20.0.5594570. Versions available locally: 21.0.6113669

Below is the CI code(Flutter CI - Customer):

name: Flutter CI - Customer

on:
  push:
    branches:
      - master
    paths:
      - holinoti_customer/**
      - .github/workflows/flutter-customer.yml

  pull_request:
    branches:
      - master
    paths:
      - holinoti_customer/**

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/[email protected]
    - name: Set up JDK 11
      uses: actions/setup-java@v1
      with:
        java-version: 11.0.2
    - name: Android NDK toolchain Setup
      uses: ravinderjangra/[email protected]
      with: 
        api: '21'
        arch: 'arm'
        install-location: 'toolchains'
    - uses: subosito/[email protected]
      with:
        flutter-version: '1.12.x' # you can use 1.12
    - name: Install dependencies
      run: flutter pub get
      working-directory: holinoti_customer
    - name: Test Build
      run: flutter build apk
      working-directory: holinoti_customer

In my local project, I set the ndk path in android studio's project structure

However, this solution is can't applied on Github Action

So, I tried to use Android NDK toolchain Setup, but still fail

Upvotes: 3

Views: 6261

Answers (2)

Yash Savsani
Yash Savsani

Reputation: 183

Check updates of SDK Tools update the NDK and CMake tools.

Upvotes: 0

Dan Albert
Dan Albert

Reputation: 10509

Instead of using the local.properties file, set ndkVersion in your build.gradle to match the one available on your CI server. i.e.

android {
    ndkVersion "21.1.6352462"
}

(I'm assuming that your CI has updated to make r21b available since then, otherwise use the 21.0.blah version from the error message.)

That way your CI and your local build both use the same version.

That was the motivation for this change, btw: keeping builds reproducible. Previously your CI and your local builds were using different versions of the NDK, and that can be a surprising and annoying source of bugs :)

Upvotes: 5

Related Questions