What can I do to solve this error?
I am coding the login page for my app, I am using SVG. Unfortunately I saw this error.
I used these codes but I did not get any results: flutter pub cache repair
flutter clean
Running Gradle task 'assembleDebug'...
../../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:88:26: Error: Type 'DiagnosticableMixin' not found.
class PictureStream with DiagnosticableMixin {
^^^^^^^^^^^^^^^^^^^
../../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:192:44: Error: Type 'DiagnosticableMixin' not found.
abstract class PictureStreamCompleter with DiagnosticableMixin {
^^^^^^^^^^^^^^^^^^^
../../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:88:7: Error: The type 'DiagnosticableMixin' can't be mixed in.
class PictureStream with DiagnosticableMixin {
^
../../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:192:16: Error: The type 'DiagnosticableMixin' can't be mixed in.
abstract class PictureStreamCompleter with DiagnosticableMixin {
^
../../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:167:11: Error: Superclass has no method named 'debugFillProperties'.
super.debugFillProperties(properties);
^^^^^^^^^^^^^^^^^^^
../../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:171:30: Error: The method 'toStringShort' isn't defined for the class 'PictureStreamCompleter'.
- 'PictureStreamCompleter' is from 'package:flutter_svg/src/picture_stream.dart' ('../../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart').
Try correcting the name to the name of an existing method, or defining a method named 'toStringShort'.
ifPresent: _completer?.toStringShort(),
^^^^^^^^^^^^^
../../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:266:11: Error: Superclass has no method named 'debugFillProperties'.
super.debugFillProperties(description);
^^^^^^^^^^^^^^^^^^^
FAILURE: Build failed with an exception.
* Where:
Script 'C:\android\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 904
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\android\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 9s
Exception: Gradle task assembleDebug failed with exit code 1
Thanks!
I fixed this error using dependency override. Add the following to your pubspec.yaml
dependency_overrides:
flutter_svg: 0.18.0
Related
How to solve this problem
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/chewie-0.9.10/lib/src/chewie_player.dar
t:276:17: Error: The method 'inheritFromWidgetOfExactType' isn't defined for the class 'Bu
ildContext'.
- 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/C:/src/flutter/p
ackages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing method, or defining a method named 'inh
eritFromWidgetOfExactType'.
context.inheritFromWidgetOfExactType(_ChewieControllerProvider)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/chewie_audio-1.0.0+1/lib/src/chewie_pla
yer.dart:101:17: Error: The method 'inheritFromWidgetOfExactType' isn't defined for the cl
ass 'BuildContext'.
- 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/C:/src/flutter/p
ackages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing method, or defining a method named 'inh
eritFromWidgetOfExactType'.
context.inheritFromWidgetOfExactType(_ChewieAudioControllerProvider)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^FAILURE: Build failed with an exception.
Where:
Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1035
What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.
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
BUILD FAILED in 1m 56s
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done 118.6s
Gradle task assembleRelease failed with exit code 1
It seems like you're using an old version of chewie. 0.9.10 is supporting an older version of Flutter. In recent versions of Flutter, inheritFromWidgetOfExactType is deprecated in favor of dependOnInheritedWidgetOfExactType. This issue was fixed in version 0.10.4 of chewie.
Upgrade the version number in your pubspec.yaml. For example to the latest version:
chewie: ^1.2.2
So I decided to upgrade the flutter to the latest stable version 2, I used flutter clean then after the flutter upgrade, I kept getting this error intl version dependency
PS D:\Flutter\flutter-app> flutter run
Because fstore depends on flutter_localizations any from sdk which depends on intl 0.17.0, intl 0.17.0 is required.
So, because fstore depends on intl ^0.16.1, version solving failed.
Running "flutter pub get" in flutter-app...
pub get failed (1; So, because fstore depends on intl ^0.16.1, version solving failed.)
so after changing the dependency to
dependency_overrides:
intl: 0.17.0
I started getting these errors, before the clean build and upgrade everything was working fine
PS D:\Flutter\codecanyon-8n5MtXRZ-fluxstore-woocommerce-flutter-ecommerce-full-app> flutter run
Launching lib\main.dart on SM N950F in debug mode...
lib/widgets/firebase/firebase_cloud_messaging_wapper.dart:32:24: Error: The method 'configure' isn't defined for the class 'FirebaseMessaging'.
- 'FirebaseMessaging' is from 'package:firebase_messaging/firebase_messaging.dart' ('../Flutter_SDK/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-8.0.0-dev.15/lib/firebase_messaging.dart').
Try correcting the name to the name of an existing method, or defining a method named 'configure'.
_firebaseMessaging.configure(
^^^^^^^^^
lib/widgets/firebase/firebase_cloud_messaging_wapper.dart:42:24: Error: The getter 'onIosSettingsRegistered' isn't defined for the class 'FirebaseMessaging'.
- 'FirebaseMessaging' is from 'package:firebase_messaging/firebase_messaging.dart' ('../Flutter_SDK/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-8.0.0-dev.15/lib/firebase_messaging.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'onIosSettingsRegistered'.
_firebaseMessaging.onIosSettingsRegistered
^^^^^^^^^^^^^^^^^^^^^^^
lib/models/user_model.dart:64:14: Error: Not a constant expression.
case AuthorizationStatus.authorized:
^^^^^^^^^^^^^^^^^^^
lib/models/user_model.dart:64:14: Error: 'AuthorizationStatus' is imported from both 'package:apple_sign_in/apple_sign_in.dart' and 'package:firebase_messaging_platform_interface/src/types.dart'.
case AuthorizationStatus.authorized:
^^^^^^^^^^^^^^^^^^^
lib/models/user_model.dart:86:14: Error: Not a constant expression.
case AuthorizationStatus.error:
^^^^^^^^^^^^^^^^^^^
lib/models/user_model.dart:86:14: Error: 'AuthorizationStatus' is imported from both 'package:apple_sign_in/apple_sign_in.dart' and 'package:firebase_messaging_platform_interface/src/types.dart'.
case AuthorizationStatus.error:
^^^^^^^^^^^^^^^^^^^
lib/models/user_model.dart:89:14: Error: Not a constant expression.
case AuthorizationStatus.cancelled:
^^^^^^^^^^^^^^^^^^^
lib/models/user_model.dart:89:14: Error: 'AuthorizationStatus' is imported from both 'package:apple_sign_in/apple_sign_in.dart' and 'package:firebase_messaging_platform_interface/src/types.dart'.
case AuthorizationStatus.cancelled:
^^^^^^^^^^^^^^^^^^^
lib/screens/home/onboard_screen.dart:207:19: Error: No named parameter with the name 'enableSlideIcon'.
enableSlideIcon: true,
^^^^^^^^^^^^^^^
../Flutter_SDK/.pub-cache/hosted/pub.dartlang.org/liquid_swipe-2.0.1/lib/liquid_swipe.dart:211:9: Context: Found this candidate, but the arguments don't match.
const LiquidSwipe({
^^^^^^^^^^^
../Flutter_SDK/.pub-cache/hosted/pub.dartlang.org/extended_image-2.0.0/lib/src/extended_image.dart:786:44: Error: No named parameter with the name 'nullOk'.
_invertColors = MediaQuery.of(context, nullOk: true)?.invertColors ??
^^^^^^
../Flutter_SDK/packages/flutter/lib/src/widgets/media_query.dart:818:25: Context: Found this candidate, but the arguments don't match.
static MediaQueryData of(BuildContext context) {
^^
../Flutter_SDK/.pub-cache/hosted/pub.dartlang.org/wave-0.1.0/lib/config.dart:46:13: Error: Method not found: 'throwNullError'.
throwNullError('custom', 'colors` or `gradients');
^^^^^^^^^^^^^^
../Flutter_SDK/.pub-cache/hosted/pub.dartlang.org/wave-0.1.0/lib/config.dart:60:13: Error: Method not found: 'throwNullError'.
throwNullError('custom', 'durations');
^^^^^^^^^^^^^^
../Flutter_SDK/.pub-cache/hosted/pub.dartlang.org/wave-0.1.0/lib/config.dart:66:13: Error: Method not found: 'throwNullError'.
throwNullError('custom', 'heightPercentages');
^^^^^^^^^^^^^^
../Flutter_SDK/.pub-cache/hosted/pub.dartlang.org/stripe_sdk-4.0.2/lib/src/models/card.dart:55:38: Error: Too few positional arguments: 2 required, 1 given.
return _ccValidator.validateCVV(cvc, cardType: cardType).isValid;
^
../Flutter_SDK/.pub-cache/hosted/pub.dartlang.org/stripe_sdk-4.0.2/lib/src/models/card.dart:57:38: Error: Too few positional arguments: 2 required, 1 given.
return _ccValidator.validateCVV(cvc).isValid;
^
FAILURE: Build failed with an exception.
* Where:
Script 'D:\Flutter\Flutter_SDK\packages\flutter_tools\gradle\flutter.gradle' line: 991
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'D:\Flutter\Flutter_SDK\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 5m 36s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 342.1s
Exception: Gradle task assembleDebug failed with exit code 1
Any help will be really appreciated.
Run 'flutter pub upgrade' . It'll update your dependencies to play along nicely with each other.
I am using the url_launcher package in flutter and it gives me this error.. If i remove this package then everythin works fine, How to fix this Thing ?
/F:/Program%20Files/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.6.0/lib/url_launcher.dart:10:8: Error: Error when reading '/F:/Program%20Files/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_platform_interface-1.0.8/lib/url_launcher_platform_interface.dart': The system cannot find the path specified.
import 'package:url_launcher_platform_interface/url_launcher_platform_interface.dart';
^
/F:/Program%20Files/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.6.0/lib/url_launcher.dart:92:29: Error: Getter not found: 'UrlLauncherPlatform'.
final bool result = await UrlLauncherPlatform.instance.launch(
^^^^^^^^^^^^^^^^^^^
/F:/Program%20Files/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.6.0/lib/url_launcher.dart:116:16: Error: Getter not found: 'UrlLauncherPlatform'.
return await UrlLauncherPlatform.instance.canLaunch(urlString);
^^^^^^^^^^^^^^^^^^^
/F:/Program%20Files/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.6.0/lib/url_launcher.dart:131:16: Error: Getter not found: 'UrlLauncherPlatform'.
return await UrlLauncherPlatform.instance.closeWebView();
^^^^^^^^^^^^^^^^^^^
FAILURE: Build failed with an exception.
* Where:
Script 'F:\Program Files\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 904
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'F:\Program Files\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 8m 42s
Exception: Gradle task assembleDebug failed with exit code 1
Hello im getting the fallowing error on console:
error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
/Users/user/Desktop/.../android/app/build/generated/rncli/src/main/java/com/facebook/react/PackageList.java:82: error: constructor ModuleRegistryAdapter in class ModuleRegistryAdapter cannot be applied to given types;
new ModuleRegistryAdapter(),
^
required: ReactModuleRegistryProvider
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 ':app: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.
on android studio:
/Users/username/.../project_name/android/app/build/generated/rncli/src/main/java/com/facebook/react/PackageList.java:82: error: constructor ModuleRegistryAdapter in class ModuleRegistryAdapter cannot be applied to given types;
new ModuleRegistryAdapter(),
^
required: ReactModuleRegistryProvider
found: no arguments
reason: actual and formal argument lists differ in length
"react-native": "~0.61.5",
"react-native-unimodules": "^0.9.1",
It seems a recent react-native-unimodules bug on android, any solutions?
this is the same error:
https://www.gitmemory.com/issue/unimodules/react-native-unimodules/58/530738183
If you use react-native-unimodules, check if you also have "#unimodules/react-native-adapter" in your package.json. If so, try removing it and rebuild. It worked for me.
In my case worked removing the "expo-react-native-adapter"
I have newly installed Flutter on Android Studio. I had a source code of flutter which I want to open using it. I installed the latest flutter plugin and flutter SDK. But when I try to run the app, it shows me the following error:
Compiler message:
/C:/Flutter%20SDK/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.14.4/lib/src/picture_stream.dart:92:3: Error: The superclass, 'Diagnosticable', has no unnamed constructor that takes no arguments.
PictureStream();
^^^^^^^^^^^^^
/C:/Flutter%20SDK/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.14.4/lib/src/picture_stream.dart:192:16: Error: The superclass, 'Diagnosticable', has no unnamed constructor that takes no arguments.
abstract class PictureStreamCompleter extends Diagnosticable {
^
Compiler message:
/C:/Flutter%20SDK/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.14.4/lib/src/picture_stream.dart:92:3: Error: The superclass, 'Diagnosticable', has no unnamed constructor that takes no arguments.
PictureStream();
^^^^^^^^^^^^^
/C:/Flutter%20SDK/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.14.4/lib/src/picture_stream.dart:192:16: Error: The superclass, 'Diagnosticable', has no unnamed constructor that takes no arguments.
abstract class PictureStreamCompleter extends Diagnosticable {
^
Target kernel_snapshot failed: Exception: Errors during snapshot creation: null
build failed.
FAILURE: Build failed with an exception.
* Where:
Script 'C:\Flutter SDK\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 882
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\Flutter SDK\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 23s
Exception: Gradle task assembleDebug failed with exit code 1
I am completely new to this and have no idea where this error is pointing. I have the latest Flutter SDK version: Flutter 1.17.0 and Dart 2.8.1, it's a stable version. My Android Studio version is 3.6.2
Try executing this in your terminal :
flutter pub cache repair
If it doesn't work, deleting the flutter folder, along with the cache folder should do the job.
In my case i solved this problem adding the latest version of flutter svg to pubspec.yaml
Check the link to install latest version: https://pub.dev/packages/flutter_svg#-installing-tab-