Could not get unknown property 'ndkVersion' for extension 'flutter' of type FlutterExtension - flutter

Issue after flutter upgrade Updated ndk but not working working fine for flutter web but on andorid showing
FAILURE: Build failed with an exception.
Where:
Build file 'D:\flutter practice\Instagramclone\android\app\build.gradle' line: 31
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 13s
Exception: Gradle task assembleDebug failed with exit code 1

For now, writing like this works fine.
android/app/build.gradle ndkVersion "23.1.7779620"
https://developer.android.com/ndk/downloads

Related

I have added the modal progress_ud and it asked me to update the compile sdk version to 32 when i updated the version it shows me the following error

FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring project ':modal_progress_hud_nsn'.
Could not load compiled classes for build file 'C:\flutter.pub-cache\hosted\pub.dartlang.org\modal_progress_hud_nsn-0.3.0\android\build.gradle' from cache.
Failed to notify project evaluation listener.
Could not get unknown property 'android' for project ':modal_progress_hud_nsn' of type org.gradle.api.Project.
Could not get unknown property 'android' for project ':modal_progress_hud_nsn' of type org.gradle.api.Project.
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 29s
Exception: Gradle task assembleDebug failed with exit code 1
I have updated the compile sdk version and having this error

flutter build in error does not run in android

FAILURE: Build failed with an exception.
Where:
Build file 'C:\Users\sajid\Desktop\amazon_clonee\android\app\build.gradle' line: 25
What went wrong:
A problem occurred evaluating project ':app'.
Could not get unknown property 'plugin' for project ':app' of type org.gradle.api.Project.
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
Exception: Gradle task assembleDebug failed with exit code 1
Any one solve this error

Could not get unknown property 'applicationVariants' for extension 'android' of type com.android.build.gradle

I Create a flutter project ,change it to library and then build aar with command "gradle aR",but the following error occurred。(flutter SDK 1.22.4 can do this without error,other version can not)
FAILURE: Build failed with an exception.
* Where:
Script 'flutter/packages/flutter_tools/gradle/flutter.gradle' line: 978
* What went wrong:
A problem occurred evaluating root project 'android'.
> A problem occurred configuring project ':app'.
> Could not get unknown property 'applicationVariants' for extension 'android' of type com.android.build.gradle.LibraryExtension.
* 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 3m 57s

FAILURE: Build failed with an exception - While using flutter and tensorflow lite

I am building a dog breed recognizer using flutter and tensorflow lite. But when I try to run the app it is giving me the error shown below -
Where: Build file 'C:\Users\Harshit\StudioProjects\dogs_breed\android\app\build.gradle'
line: 28
What went wrong: A problem occurred evaluating project ':app'.
No signature of method: build_dast028lnupf053g0npys7hra.android() is applicable for argument types:
(build_dast028lnupf053g0npys7hra$_run_closure2) values:
[build_dast028lnupf053g0npys7hra$_run_closure2#582f5b39]
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 1m 55s Exception: Gradle task assembleDebug failed
with exit code 1
This is the line 28 which is responsible for error as shown in the terminal

Could not get unknown property 'flutter' for extension 'android' of type com.android.build.gradle.internal.dsl.BaseAppModuleExtension

1. I treid uninstalling android studio and reinstalling latest version of android studio.
2. tried changing sdk version.
3.even tried changing dependy
and what not
it's been 2 days since i'm trying to solve this error. please help me to get over this
FAILURE: Build failed with an exception.
Where:
Build file 'C:\Users\91893\StudioProjects\kuk\android\app\build.gradle' line: 29
What went wrong:
A problem occurred evaluating project ':app'.
Could not get unknown property 'flutter' 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 1s
Exception: Gradle task assembleDebug failed with exit code 1