Getting Flutter FAILURE: Build failed with an exception - flutter

What went wrong:
A problem occurred configuring project ':firebase_auth'.
Could not load compiled classes for build file 'C:\flutter.pub-cache\hosted\pub.dartlang.org\firebase_auth-3.3.19\android\build.gradle' from cache.
Failed to notify project evaluation listener.
Could not get unknown property 'android' for project ':firebase_auth' of type org.gradle.api.Project.
Could not find method implementation() for arguments [project ':firebase_core'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Could not get unknown property 'android' for project ':firebase_auth' of type org.gradle.api.Project.

Related

Flutter app error: could not get unknown property 'android' for project ':flutter_native_splash' of type org.gradle.api.Project

I run my flutter app and I got this error message:-
A problem occurred configuring project ':flutter_native_splash'.
Could not load compiled classes for build file 'C:\Users\df\Desktop\flutter.pub-cache\hosted\pub.dartlang.org\flutter_native_splash-2.2.16\android\build.gradle' from cache.
Failed to notify project evaluation listener.
Could not get unknown property 'android' for project ':flutter_native_splash' of type org.gradle.api.Project.
Could not get unknown property 'android' for project ':flutter_native_splash' of type org.gradle.api.Project.

Flutter Pub Cache Error build gradle error

^^^^^^^^^^^^^^^^^^^^
/D:/flutter_3.0.5/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-2.4.1/lib/src/firebase_app.dart:18:25: Error: Member not found: 'FirebaseAppPlatform.verify'.
FirebaseAppPlatform.verify(_delegate);
^^^^^^
lib/screens/kilofarmsWebview.dart:22:13: Error: The method 'WebView' isn't defined for the class 'KilofarmsWebview'.
'KilofarmsWebview' is from 'package:ruby/screens/kilofarmsWebview.dart' ('lib/screens/kilofarmsWebview.dart').
Try correcting the name to the name of an existing method, or defining a method named 'WebView'.
How to Solve this error. i was run my another laptop build gradle works fine. but my current system not worked in build gradle. but both are same setup.
How to Solve this error. i was run my another laptop build gradle works fine. but my current system not worked in build gradle. but both are same setup.

When I run my flutter code I face the following Gradle Dependency problem. What should I do?

I have tried to solve it through different pre-answered questions on StackOverflow but they are not working, That is why asking here, Please help.
here is the problem:
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\TME_Education\StudioProjects\jeda\android\app\build.gradle' line: 58
* What went wrong:
A problem occurred evaluating project ':app'.
> Could not find method compile() for arguments [com.android.tools.build:gradle:7.1.2] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Here is my dependency
dependencies {
compile 'com.android.tools.build:gradle:7.1.2'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
I was runing the code but this gradle Dependency eror happened.

A problem occurred configuring project ':shared_preferences_android'

I was trying to use this dependency but the problem is that my terminal couldn't access the directory due to my user name. I have a school organization account, and after the name it has a "(St" after my name. I tried to cd into that directory but it tells me that is requires a "close parentheses" or ")". How can I fix this?
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring project ':shared_preferences_android'.
Could not resolve all dependencies for configuration ':shared_preferences_android:classpath'.
Could not load module metadata from C:\Users\BoneteJobertJanne(St.gradle\caches\modules-2\metadata-2.97\descriptors\org.jetbrains.kotlin\kotlin-reflect\1.5.31\a8be1fe3b3911d3d3425fe720cf42835\descriptor.bin
Failed to notify project evaluation listener.
Could not get unknown property 'android' for project ':shared_preferences_android' of type org.gradle.api.Project.
Could not get unknown property 'android' for project ':shared_preferences_android' of type org.gradle.api.Project.

Unexpected lock protocol found in lock file. this error started when i run on android device. it is fine while run on chrome

FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring project ':file_picker'.
java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Unexpected lock protocol found
in lock file. Expected 1, found 0.
Failed to notify project evaluation listener.
Could not get unknown property 'android' for project ':file_picker' of type org.gradle.api.Project.
Could not find method implementation() for arguments [project ':flutter_plugin_android_lifecycle'] on
object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Could not get unknown property 'android' for project ':file_picker' 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 11m 19s
Running Gradle task 'assembleDebug'... 693.6s
Exception: Gradle task assembleDebug failed with exit code 1
your pubspec.yaml package does not match with your gradle version
1. find which package[example: file_picker] does not match with your gradle.
2. go to the dependecies[lef side on vscode] -> direct
dependecy -> package[example: file_picker] -> example
-> android -> build.gradle [ example classpath 'com.android.tools.build:gradle:7.0.1' ]
3. follow step 2. -> and android -> gradle ->
wrapper [exapmle distributionUrl=https://services.gradle.org/distributions/gradle-7.0.2-all.zip]
4. please copy the distributed url from the step 3, and paste
into your project android-> gradle -> wrapper
5. also paste the example classpath
'com.android.tools.build:gradle:7.0.1' to your project andorid ->
build.gradle
this answer https://stackoverflow.com/a/67920804/17971818 helped me