No named parameter with the name interactive - flutter

When I run my flutter application on android studio this error appear, I did flutter clean and many commands but it didn't work.
../../snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/dropdown_search-0.6.3/lib/src/selectDialog.dart:193:23: Error: No named parameter with the name 'interactive'.
interactive: widget.scrollbarProps?.interactive,
^^^^^^^^^^^
../../snap/flutter/common/flutter/packages/flutter/lib/src/material/scrollbar.dart:63:9: Context: Found this candidate, but the arguments don't match.
const Scrollbar({
^^^^^^^^^
FAILURE: Build failed with an exception.
* Where:
Script '/home/saava/snap/flutter/common/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 991
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/home/saava/snap/flutter/common/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 4m 41s

The interactive property of Scrollbar was added in Flutter 2.2. If you are using a version older than that, this package (or at least this version of the package) won't work for you. The package's release notes don't make it clear which version you should be using, though, but it will probably be some point from 0.5.0 onward since that was the release which supported null safety which corresponds to Flutter 2.0.
Alternatively, you can just update your version of Flutter to 2.2+. (At time of writing, the latest version of Flutter on the stable channel is 2.2.2.)

Related

PackageManager has been deprecated

I have a project in flutter that I developed a few years ago. I have flutter version 2.10.4 installed on my computer. When I want to run the application on my computer, the Android studio console shows me the following message:
/Users/rodrigosanchez/development/flutter/.pub-cache/hosted/pub.dartlang.org/android_intent-2.0.2/android/src/main/java/io/flutter/plugins/androidintent/IntentSender.java:87: warning: [deprecation] resolveActivity(Intent,int) in PackageManager has been deprecated
return packageManager.resolveActivity(intent, PackageManager.MATCH_DEFAULT_ONLY) != null;
^
error: warnings found and -Werror specified
1 error
1 warning
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':android_intent:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* 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 9s
Exception: Gradle task assembleDebug failed with exit code 1
I hope you can help me.
Thanks so much for reading.
Run the app on Android device.
Thanks
it seem happen because android_intent package is discontinued and replacing by android_intent_plus package. try changing your package and choose the package version that matched to your current SDK version.

What should I do if I want to use a dependency and it doesn't support null safety?

I'm trying to use Geocoder Dependence but it does not don't support null safety. Is there any method to use Geocoder Dependence in the project?
Here is the error
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
Error: Cannot run with sound null safety, because the following dependencies
don't support null safety:
- package:geocoder
For solutions, see https://dart.dev/go/unsound-null-safety
FAILURE: Build failed with an exception.
* Where:
Script 'C:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1035
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\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
BUILD FAILED in 27s
Exception: Gradle task assembleDebug failed with exit code 1
There seems to be some recent activity on the geocoder package where the version on the master branch is now null-safety compatible but the version has yet to be released on pub.dev. You can check this issue here there are also some suggestion about how to use the master version directly instead of fetching the package from pub.dev:
https://github.com/aloisdeniel/flutter_geocoder/issues/68
Alternative, you can take a look at the flutter_geocoder package which seems to be a fork of geocoder and does support null-safety according to pub.dev.
And I know, it is confusing that the geocoder package does calls its GitHub repository for flutter_geocoder. But flutter_geocoder and geocoder is two different packages on pub.dev with different GitHub projects behind it which both has the same name but is created by different users. :)

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.

Flutter Update issues

My flutter code works perfectly fine and I have run multiple tests on it.
I just decided to install the new VS code updates and restart my VS code application.
All of the sudden I started having the error below and I have searched the entire code for the method but none was found
Launching lib\main.dart on Android SDK built for x86 in debug mode...
lib\main.dart
../../../flutter_windows_1.22.3-stable/flutter/packages/flutter/lib/src/widgets/navigator.dart:3783:32: Error: Getter not found: 'deoNotPop'.
case RoutePopDisposition.deoNotPop:
^^^^^^^^^
FAILURE: Build failed with an exception.
* Where:
Script 'C:\Users\temp\flutter_windows_1.22.3-stable\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 904
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\Users\temp\flutter_windows_1.22.3-stable\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
BUILD FAILED in 1m 26s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
Someone, please help me
It looks like you may have inadvertedly modified a Flutter SDK file:
flutter/packages/flutter/lib/src/widgets/navigator.dart
case RoutePopDisposition.deoNotPop:
This should say doNotPop and not doeNotPop. Removing the e and saving the file should fix it. You can run git status in your Flutter SDK to see if there are other changes that may need reverting.

Error of compilation after add firebase messaging

For an applications development I need firebase cloud messaging.
In my pubsepc.yaml I add this dependencies : firebase_messaging: ^5.1.6
I don't have add code for the moment.
Afterward I build code and I have error :
flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-5.1.6/android/src/main/java/io/flutter/plugins/firebasemessaging/FlutterFirebaseMessagingService.java:143: error: method findAppBundlePath in class FlutterMain cannot be applied to given types;
String appBundlePath = FlutterMain.findAppBundlePath();
^
required: Context
found: no arguments
reason: actual and formal argument lists differ in length
1 error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':firebase_messaging:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* 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
Finished with error: Gradle task assembleDebug failed with exit code 1
If you go to Java and check FlutterFirebaseMessagingService.java
FlutterMain.findAppBundlePath()
it required context in the argument here so 1st solution is here you can add context in the argument like this way
FlutterMain.findAppBundlePath(context)
The second solution remove firebase_messaging: ^5.1.6 dependency from pubspac.yaml and hit flutter clean in terminal to clean, now add firebase_messaging: 5.1.6 (without ^) and hit flutter pub get in terminal. This solution works for me.
The second solution is the better practice.
The answer of #Maddy is clear. But if someone is not solved the problem.
Please try: flutter upgrade and do #Maddy answer
This works for me.
Sorry about new thread answer, I don't have enough reputation