简体   繁体   中英

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

Here is my flutter doctor:-

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:-

* 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

here is some steps to set ndk in your project

  1. download ndk side by side from sdk manager

  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

  3. Add ndkVersion in your app build.gradle file in android->app->build.gradle Like this:- android { compileSdkVersion 31 ndkVersion '23.1.7779620' }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM