A problem occurred configuring project ':google_maps_flutter_android' in flutter - flutter

I got a gradle related error: A problem occurred configuring project':google_maps_flutter_android'. When I want to build an application on the emulator, I immediately get this error. Although I did not change anything and before that everything worked fine. I did flutter clean, flutter pub cache repair - but it didn't solve my problem. What could be the problem?
What went wrong: A problem occurred configuring project ':google_maps_flutter_android'.
Could not load compiled classes for build file 'C:\flutter.pub-cache\hosted\pub.dartlang.org\google_maps_flutter_android-2.4.3\android\build.gradle'
from cache.
Failed to notify project evaluation listener.
Could not get unknown property 'android' for project ':google_maps_flutter_android' 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 ':google_maps_flutter_android' of type org.gradle.api.Project.
flutter doctor
error

Related

I am not able to run my flutter app beacause of this error of Jitsi meet package for FLUTTER

Launching lib\main.dart on CPH2381 in debug mode...
Running Gradle task 'assembleDebug'...
WARNING: [Processor] Library 'C:\Users\Yusuf Ansari\.gradle\caches\modules-2\files-2.1\com.facebook.react\react-native-webrtc\1.89.1-jitsi-7097494\2eba38ea6be677eccbf67760c601f477edaf08dd\react-native-webrtc-1.89.1-jitsi-7097494.aar' contains references to both AndroidX and old support library. This seems like the library is partially migrated. Jetifier will try to rewrite the library anyway.
Example of androidX reference: 'androidx/core/view/ViewCompat'
Example of support library reference: 'android/support/annotation/Nullable'
e: C:\Users\Yusuf Ansari\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\jitsi_meet-4.0.0\android\src\main\kotlin\com\gunschu\jitsi_meet\JitsiMeetPlugin.kt: (66, 42): Type mismatch: inferred type is Activity? but Activity was expected
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':jitsi_meet:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
> Compilation error. See log for more details
I tried changing the Kotlin version but it's still not resolving this issue

When running the App, I get the error: Cannot find 'webviewController' in scope

I have searched the internet but cannot find others with the same problem. Does any one know how to fix the below error?
After updated XCode to version 14.0, my Flutter app failed to build. I have found out that the problematic package is html_editor_enhanced. If I remove it, then the build is successful, but I need it for allowing WYSIWYG editor. I see that it depends on another package called flutter_inappwebview, so I added it, but to no avail. When I try to build, the error in VSCode is:
Swift Compiler Error (Xcode): Cannot find 'webviewController' in scope /Users/<username>/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.4.3+7/ios/Classes/InAppWebView/FlutterWebViewFactory.swift:32:8 2
Swift Compiler Error (Xcode): Cannot find 'webviewController' in scope /Users/<username>/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-5.4.3+7/ios/Classes/InAppWebView/FlutterWebViewFactory.swift:33:15
And in XCode, the error is:
Cannot find 'webviewController' in scope
Below is the screenshot from XCode.
running the following command fixed the problem:
flutter pub cache repair

After a Flutter upgrade, I am getting the error "Could not resolve all files for configuration ':app:debugRuntimeClasspath'"

When I upgraded Flutter from Flutter 2.10.2 to a newer version, I got this error on every Flutter project I had created. Even when I created the new Flutter project (the simple counter app) when I am going to run the app, I am getting this error.
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not resolve io.flutter:x86_debug:1.0.0-bd539267b42051b0da3d16ffa8f48949dce8aa8f. Required by: project :app
> Could not resolve io.flutter:x86_debug:1.0.0-bd539267b42051b0da3d16ffa8f48949dce8aa8f.
> Could not parse POM https://storage.googleapis.com/download.flutter.io/io/flutter/x86_debug/1.0.0-bd539267b42051b0da3d16ffa8f48949dce8aa8f/x86_debug-1.0.0-bd539267b42051b0da3d16ffa8f48949dce8aa8f.pom

Flutter Error: No named parameter with the name 'keyboardDismissBehavior'

The flutter project ran well on my android device before i ran flutter grade command. And then the project just cant run anyway without any code change. Here is the error message:
Launching lib/main.dart on RMX1971 in debug mode...
Running Gradle task 'assembleDebug'...
../../env/flutter/.pub-cache/hosted/pub.flutter-io.cn/pull_to_refresh-1.6.4/lib/src/smart_refresher.dart:434:9: Error: No named parameter with the name 'keyboardDismissBehavior'.
keyboardDismissBehavior:
^^^^^^^^^^^^^^^^^^^^^^^
../../env/flutter/packages/flutter/lib/src/widgets/scroll_view.dart:588:9: Context: Found this candidate, but the arguments don't match.
const CustomScrollView({
^^^^^^^^^^^^^^^^
FAILURE: Build failed with an exception.
Where:
Script '/Users/lgk/env/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 907
What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
Process 'command '/Users/lgk/env/flutter/bin/flutter'' finished with non-zero exit value 1
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 14s
Exception: Gradle task assembleDebug failed with exit code 1
This is actually a compatibility issue between pull_to_refresh plugin and the current version of Flutter during this time. There are some bugs related to this and most of the solutions were found on the thread:
https://github.com/peng8350/flutter_pulltorefresh/issues/427
https://github.com/peng8350/flutter_pulltorefresh/issues/424
To summarized the solution from this thread:
How to solve Error: No named parameter with the name 'keyboardDismissBehavior' ?
to solve Error: No named parameter
with the name 'keyboardDismissBehavior' This error is caused due to
pull_to_refresh plugin that you are using in your flutter app is not
compatible with the current version of flutter. The solution is just
downgraded your plugin version.
Error: No named parameter with the name 'keyboardDismissBehavior
to solve Error: No named parameter with
the name 'keyboardDismissBehavior' This error is caused due to
pull_to_refresh plugin that you are using in your flutter app is not
compatible with the current version of flutter. The solution is just
downgraded your plugin version.
Solution 1
This error is cause due to pull_to_refresh plugin that you are using
in your flutter app that is not compatible with the current version of
flutter. The solution is just to downgrade your plugin version. Just
Follow below step to solve this error.
Edit file pubspec.yaml
Change This Line pull_to_refresh ^1.6.4 or pull_to_refresh ^1.6.3
Replace with pull_to_refresh 1.6.3
run flutter clean
flutter run
Solution 2
pull_to_refresh plugin is not compatible with the current version of
flutter.

Target kernel_snapshot failed: Exception: Errors during snapshot creation: null build failed

I have updated to the latest flutter update. When I want to start the project, it returns an error. The project depends on several repositories and I don't know if that is why. I have tried multiple solutions but they do not solve the error. Hope someone can help me. thanks.
Compiler message:
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/mvvm-0.1.7/lib/view_context_helpers/logical.dart:151:25: Error: The function expression type 'Widget Function(BuildContext, Null, Widget) Function(TValue)' isn't of expected type 'Widget Function(BuildContext, TValue, Widget) Function(TValue)'.
- 'Widget' is from 'package:flutter/src/widgets/framework.dart' ('/C:/src/flutter/packages/flutter/lib/src/widgets/framework.dart').
- 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/C:/src/flutter/packages/flutter/lib/src/widgets/framework.dart').
Change the type of the function expression or the context in which it is used.
selector: (TValue value) =>
^
Target kernel_snapshot failed: Exception: Errors during snapshot creation: null
build failed.
FAILURE: Build failed with an exception.
* Where:
Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 780
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\src\flutter\bin\flutter.bat'' finished with non-zero exit value 1
* 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
BU�LD FAILED in 31s
Finished with error: Gradle task assembleDebug failed with exit code 1
i found this issue issue TL:DR here is a summary
It looks like your local engine build flutter/engine and framework + tool flutter/flutter are out of sync: You're using an engine from when after SemanticsFlag.isLink was added, but a framework/tool from before it rolled into the framework.
You need to ensure that you're using compatible engines and frameworks. In this case, you need to either update flutter/flutter to a newer version or roll back flutter/engine to an older version.42356
Solution 1
1.Ensure compatible engines and frameworks.
2.Update flutter or install flutter to a newer version,
still issue persists, Roll back flutter or engine to an older version.
Best solution to fix by time saving but not preferable, please follow
Solution 2
1. Download latest version flutter sdk and setup.
2. Fix it by creating a new project and copying the code from the old one.
For more details refer the below link
http://codekhichdi.com/flutter/target-kernel_snapshot-failed-exception-errors-during-snapshot-creation-null
If upgrade/downgrade as mentioned above still doesn't fix the issue, perhaps the flutter channel is in master or else. Change the channel to 'stable' with:
flutter channel stable
After changing the channel, upgrade it:
flutter upgrade
reopen the editor/ide to make sure it's using the new engine, and then run your project.
This method worked for me.