如何使用CODEMAGIC CI/CD接口添加使用Flutter Android构建的NDK?

发布于 2025-02-05 06:28:24 字数 215 浏览 2 评论 0原文

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

此应用程序包包含本机代码,而且您没有上传调试符号。我们建议您上传一个符号文件,以使您的崩溃和ANRS更容易分析和调试。

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

I am learning CI/CD Workflows for Flutter apps, I have successfully set up the CI/CD for the flutter android app but it still shows the warning while submitting through CI/CD as follows:

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.

whereas it does not show any warning when I manually build the app and submit it to the play store.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

挽袖吟 2025-02-12 06:28:24

1。 在Android Studio中安装NDK(并排)

,将NDK安装到您的Flutter Project中,从

  • 开放项目中遵循这些步骤,Select Tools> Android>主菜单中的SDK管理器。
  • 单击SDK工具选项卡。
  • 选中框以显示软件包的详细信息,并记下版本编号
  • 检查NDK,CMAKE和ANDROID SDK命令行旁边的框,
  • 单击apply

安装ndk和cmake in android SDK管理器

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


android {
    compileSdkVersion 30

    ndkVersion "21.1.6352462" // << Add this line with your version of the NDK

    ... 
}

请参见此处的NDK文档有关安装NDK的更多详细信息。

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

在构建设置下确保您是构建供您发布而不是调试

1. Install the NDK (Side By Side)

In Android Studio, install the NDK to your Flutter Project by following these steps

  • From an open project, select Tools > Android > SDK Manager from the main menu.
  • Click the SDK Tools tab.
  • Check the box to Show Package Details and note the version number
  • Check the box next to NDK, CMake, and Android SDK Command-line Tools
  • Click Apply

Install NDK and CMake in Android SDK Manager

After the necessary files are installed, go to File > Project Structure > SDK and select the NDK version.
or add this line to your ./android/app/src/build.gradle file


android {
    compileSdkVersion 30

    ndkVersion "21.1.6352462" // << Add this line with your version of the NDK

    ... 
}

See the NDK documentation here for more details on installing the NDK.

2. CodeMagic Build Settings
In your Project Set up on codemagic.io make sure you're building for release then try building your app again.

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

没有你我更好 2025-02-12 06:28:24

这是部分答案。我从

#!/usr/bin/env sh
pushd build/app/intermediates/merged_native_libs/release/out/lib
zip -r $CM_EXPORT_DIR/aab-debug-symbols.zip *
popd

It's a partial answer. I took the solution from this answer and wrote a post-build script. The script, shared below, creates the required debug symbol zip that we can upload manually. I haven't automated the distribution step so I can't say what we need to do there.

#!/usr/bin/env sh
pushd build/app/intermediates/merged_native_libs/release/out/lib
zip -r $CM_EXPORT_DIR/aab-debug-symbols.zip *
popd
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文