【问题标题】:"Could not get unknown property 'ndkVersion' for extension 'flutter' of type FlutterExtension"无法获得 FlutterExtension 类型的扩展“flutter”的未知属性“ndkVersion”
【发布时间】:2022-09-28 18:30:22
【问题描述】:

大家,早安

我对颤振和飞镖真的很陌生,在尝试编译我的项目时我收到了这个错误

FAILURE: Build failed with an exception.

* Where:

* What went wrong:
A problem occurred evaluating project \':app\'.
> Could not get unknown property \'ndkVersion\' for extension \'flutter\' of type FlutterExtension.
* 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 2s

我能做些什么来解决这个问题?

我正在使用 vs 代码,我刚刚从 git 重新安装了 Flutter,已经尝试过

flutter clean

flutter upgrade

但似乎没有任何效果

提前感谢,祝你有美好的一天

    标签: flutter dart


    【解决方案1】:

    转到 android>app>build.gradle 并将 flutter.ndkVersion 更改为最新的稳定版本。 您可以在这里查看最新的 ndk 稳定版本:https://developer.android.com/ndk/downloads

    你从这里开始:before

    对此:before

    【讨论】:

      【解决方案2】:

      转到文件 => android\app\build.gradle

      并编辑 ndkVersion flutter.ndkVersion 到 ndkVersion “23.1.7779620”

      您可以从官方网站找到最新版本 https://developer.android.com/ndk/downloads

      【讨论】:

        【解决方案3】:

        上面的解决方案对我有用。只是在这里重新回应它。

        转到android\app\build.gradle 文件

        android {
            compileSdkVersion flutter.compileSdkVersion
            ndkVersion flutter.ndkVersion // line to change
        

        并将ndkVersion 更改为最新版本。大概在30号线左右。

        android {
            compileSdkVersion flutter.compileSdkVersion
            ndkVersion "23.1.7779620"
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2019-04-30
          • 2021-09-14
          • 2021-06-20
          • 2022-08-21
          • 2018-01-31
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多