簡體   English   中英

Flutter 將 flutter 更新到 2.8.1 后編譯代碼時拋出錯誤

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

我使用 flutter 使我的跨平台應用程序體驗如此流暢,它會超出我的預期,但是在將 flutter 更新到 2.8.1 后,它會拋出錯誤,就像我在下面提到的那樣是因為我的代碼而發生錯誤,或者存在 flutter 問題在評論中告訴我

這是我的 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!

這是 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

我認為您的 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. 在你的應用程序中添加 ndkVersion build.gradle 文件在 android->app->build.gradle 像這樣:- android { compileSdkVersion 31 ndkVersion '23.1.7779620' }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM