【问题标题】:Flutter throw error while compile code after update flutter to 2.8.1更新 Flutter 到 2.8.1 后编译代码时 Flutter 抛出错误
【发布时间】:2021-12-31 09:05:06
【问题描述】:

我使用颤振使我的跨平台应用程序体验如此流畅,它会超出我的预期,但是在将颤振更新到 2.8.1 之后它会抛出错误,如下面提到的错误是由于我的代码或有颤振问题请在评论中告诉我

这是我的颤振医生:-

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!

这里是 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

【问题讨论】:

    标签: android flutter dart cross-platform


    【解决方案1】:

    我觉得你的flutter版本在你的目录下找不到ndk

    这里是在你的项目中设置 ndk 的一些步骤

    1. 从 sdk 管理器并排下载 ndk

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

    3. 在你的应用程序 build.gradle 文件中添加 ndkVersion 在 android->app->build.gradle 像这样:- 安卓 { compileSdkVersion 31 ndkVersion '23.1.7779620' }

    【讨论】:

      猜你喜欢
      • 2021-08-07
      • 2021-07-25
      • 2023-01-10
      • 1970-01-01
      • 2020-08-12
      • 2021-02-03
      • 2020-10-19
      • 2022-09-29
      • 2021-05-22
      相关资源
      最近更新 更多