Help FAILURE: Build failed with an exception

hello… have you any idea with this errors ?

Launching lib\main.dart on sdk gphone x86 in debug mode…
Running Gradle task ‘assembleDebug’…

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring project ‘:app’.

Failed to notify project evaluation listener.
‘org.gradle.api.file.RegularFileProperty org.gradle.api.file.ProjectLayout.fileProperty(org.gradle.api.provider.Provider)’
Could not get unknown property ‘ndkVersion’ for extension ‘android’ of type com.android.build.gradle.internal.dsl.BaseAppModuleExtension.

  • 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 6s
Exception: Gradle task assembleDebug failed with exit code 1

Isn’t the error pretty meaningful?
You try to access property ndkVersion on extension android, but it does not exist.

My general recommendation is to use Kotlin DSL instead of Groovy DSL,
becaues then you get statically typed type-safe build scripts immediately,
along with amazingly better IDE support.

Thank you very much for your help. I am at the beginning in this field. how should i switch to kotlin dsl?

https://docs.gradle.org/current/userguide/migrating_from_groovy_to_kotlin_dsl.html