简体   繁体   English

Flutter 将 flutter 更新到 2.8.1 后编译代码时抛出错误

[英]Flutter throw error while compile code after update flutter to 2.8.1

I use flutter to make my cross platform app the experience is so smooth and it will work above my expectations but after update flutter to 2.8.1 it throw error like I mention below is that error occurs because of my code or there is flutter issue please let me know in comment我使用 flutter 使我的跨平台应用程序体验如此流畅,它会超出我的预期,但是在将 flutter 更新到 2.8.1 后,它会抛出错误,就像我在下面提到的那样是因为我的代码而发生错误,或者存在 flutter 问题在评论中告诉我

Here is my flutter doctor:-这是我的 flutter 医生:-

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.8.1, on macOS 11.5.2 20G95 darwin-x64, locale
    en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] IntelliJ IDEA Ultimate Edition (version 2021.2.2)
[✓] VS Code (version 1.59.1)
[✓] Connected device (2 available)
    ! Error: iPad is busy: Waiting for Device. Xcode will continue when iPad is
      finished. (code -10)
    ! Error: iPhone 7 is not connected. Xcode will continue when iPhone 7 is
      connected. (code -13)

• No issues found!

Here is eroor log:-这是 eroor 日志:-

* What went wrong:
Execution failed for task ':app:stripDebugDebugSymbols'.
> No version of NDK matched the requested version 21.0.6113669. Versions available locally: 23.1.7779620

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 40s
Exception: Gradle task assembleDebug failed with exit code 1

I think your flutter version can't find ndk in your directory我认为您的 flutter 版本在您的目录中找不到 ndk

here is some steps to set ndk in your project这是在您的项目中设置 ndk 的一些步骤

  1. download ndk side by side from sdk manager从 sdk 管理器并排下载 ndk

  2. Add Ndk path to your local.properties file in android-> local.properties Like this:- ndk.dir=/Users/imac/Library/Android/sdk/ndk/23.1.7779620在 android-> local.properties 中将 Ndk 路径添加到 local.properties 文件中,如下所示:- ndk.dir=/Users/imac/Library/Android/sdk/ndk/23.1.7779620

  3. Add ndkVersion in your app build.gradle file in android->app->build.gradle Like this:- android { compileSdkVersion 31 ndkVersion '23.1.7779620' }在你的应用程序中添加 ndkVersion build.gradle 文件在 android->app->build.gradle 像这样:- android { compileSdkVersion 31 ndkVersion '23.1.7779620' }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 即使在 Flutter 中定义了 errorBuilder 之后,Image.network 也会抛出错误 - Image.network throw error even after defining errorBuilder in Flutter 更新 flutter sdk 和所有包后出错 - error after update flutter sdk and all packages Android minSdkVersion with Flutter(v2.8.1) - Android minSdkVersion with Flutter(v2.8.1) flutter:Gradle 在尝试自我更新时抛出错误。 正在重试更新... Gradle 任务 assembleDebug 失败,退出代码为 1 - flutter : Gradle threw an error while trying to update itself. Retrying the update… Gradle task assembleDebug failed with exit code 1 为什么我的 Flutter 应用程序在我的设备上安装应用程序时会引发 dex 错误? - Why does my Flutter app throw dex error while installing application on my device? Firebase 更新后在 Flutter 上发消息 - Firebase Messaging on Flutter after update 更新 flutter SDK 2.0 后出现错误 DiagnosticableMixin - Getting error DiagnosticableMixin after Update flutter SDK 2.0 Android 更新后应用无法运行并显示错误 flutter - Android app not run and show error after update flutter 添加flutter_email_sender插件后Flutter无法编译 - Flutter does not compile after adding flutter_email_sender plugin Flutter 2.8.1 Null 检查用于 null 值的运算符 - Flutter 2.8.1 Null check operator used on a null value
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM