gpt4 book ai didi

flutter - Github 操作 Flutter CI 错误 : No version of NDK matched

转载 作者:行者123 更新时间:2023-12-05 02:08:10 26 4
gpt4 key购买 nike

Project Repository

我一直在推送 commit

但是,我得到了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

以下是CI代码(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/checkout@v2.0.0
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11.0.2
- name: Android NDK toolchain Setup
uses: ravinderjangra/android-ndk-toolchain-setup@0.1
with:
api: '21'
arch: 'arm'
install-location: 'toolchains'
- uses: subosito/flutter-action@v1.1.1
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

在我的本地项目中,我在android studio的项目结构中设置了ndk路径

但是,这个方案不能应用在Github Action上

因此,我尝试使用Android NDK toolchain Setup,但仍然失败

最佳答案

不要使用 local.properties 文件,而是在 build.gradle 中设置 ndkVersion 以匹配 CI 服务器上可用的版本。即

android {
ndkVersion "21.1.6352462"
}

(我假设您的 CI 从那时起已更新以使 r21b 可用,否则使用错误消息中的 21.0.blah 版本。)

这样您的 CI 和本地构建都使用相同的版本。

顺便说一下,这就是进行此更改的动机:保持构建的可重现性。以前您的 CI 和您的本地构建使用不同版本的 NDK,这可能是一个令人惊讶和恼人的错误来源:)

关于flutter - Github 操作 Flutter CI 错误 : No version of NDK matched,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61146248/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com