【问题标题】:How to add NDK with flutter android build using CodeMagic CI/CD Interface?如何使用 CodeMagic CI/CD 接口在 Flutter android 构建中添加 NDK?
【发布时间】:2022-08-14 18:52:00
【问题描述】:

我正在学习 Flutter 应用程序的 CI/CD 工作流,我已经成功地为 Flutter android 应用程序设置了 CI/CD,但它在通过 CI/CD 提交时仍然显示警告,如下所示:

This App Bundle contains native code, and you\'ve not uploaded debug symbols. We recommend you upload a symbol file to make your crashes and ANRs easier to analyze and debug.

而当我手动构建应用程序并将其提交到 Play 商店时,它没有显示任何警告。

    标签: android flutter cicd codemagic


    【解决方案1】:

    1. 安装 NDK(并排)

    在 Android Studio 中,按照以下步骤将 NDK 安装到您的 Flutter 项目中

    • 从打开的项目中,从主菜单中选择工具 > Android > SDK 管理器。
    • 单击 SDK 工具选项卡。
    • 选中显示包详细信息框并记下版本号
    • 选中 NDK、CMake 和 Android SDK 命令行工具旁边的框
    • 点击应用

    Install NDK and CMake in Android SDK Manager

    安装必要的文件后,转到文件 > 项目结构 > SDK 并选择 NDK 版本。 或将此行添加到您的./android/app/src/build.gradle文件


    android {
        compileSdkVersion 30
    
        ndkVersion "21.1.6352462" // << Add this line with your version of the NDK
    
        ... 
    }
    

    有关安装 NDK 的更多详细信息,请参阅the NDK documentation here

    2. CodeMagic 构建设置在您在 codemagic.io 上设置的项目中,确保您正在为发布而构建,然后再次尝试构建您的应用程序。

    Under build settings make sure you're building for release and not debug

    【讨论】:

      猜你喜欢
      • 2020-01-08
      • 2020-05-24
      • 2021-01-13
      • 2020-06-21
      • 2021-06-25
      • 1970-01-01
      • 2020-12-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多