I am not able to use flutter. It just stopped randomly working fine like 5 mins ago due to this sdk error - flutter

Building flutter tool...
Error: Error when reading '../../../flutter/packages/flutter_tools/.packages': No such file or directory
Error: Couldn't resolve the package 'flutter_tools' in 'package:flutter_tools/executable.dart'.
../../../flutter/packages/flutter_tools/bin/flutter_tools.dart:7:8: Error: Not found: 'package:flutter_tools/executable.dart'
import 'package:flutter_tools/executable.dart' as executable;
^
../../../flutter/packages/flutter_tools/bin/flutter_tools.dart:10:14: Error: Method not found: 'main'.
executable.main(args);
^^^^
I had the issue in this post before and i followed its solution : I am not able to use flutter as im getting an error with the dart sdk, only it has been working for weeks until today then i ran into the error above.. anything i can do..

I reinstalled flutter linux version and it works just fine.

Related

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

Can anyone tell me what is this error in flutter when I am trying to add syncfusion_flutter_pdfviewer package

When I add syncfusion_flutter_pdfviewer package in yaml file I am getting the below error. can anyone tell me what is that error states ?
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_pdfviewer-20.2.48-beta/lib/src/common/pdfviewer_plugin.dart:21:23: Error: Type 'Uint8List' not found.
CancelableOperation<Uint8List?>? _nativeImage;
^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_pdfviewer-20.2.48-beta/lib/src/common/pdfviewer_plugin.dart:24:37: Error: Type 'Uint8List' not found.
After adding package, application should be compiled again.
Try running a command in terminal.
flutter run -d [device id]
UPDATE:
Also try to:
import 'dart:typed_data';
in a file where you are using syncfusion components.
The issue was also resolved for me by upgrading to the latest Flutter version (as of 22 October 2022).
Upgrade flutter to the latest version. This issue was solved after I upgraded to version 3.3.1.

flutter agora rtc engine : error: Method not found: '$enumDecode'

I am using agora_rtc_engine package with version 4.2.2 and I get this error when I run my app:
Error: Method not found: '$enumDecode'.
$enumDecode(_$AudioDeviceTestVolumeTypeEnumMap, json['volumeType'])
I have also tried to use the latest version but I get the same error.
I'd like to know how solve this issue.

Error while running Flutter Web Project lib/generated_plugin_registrant.dart:16:3: Error: Getter not found: 'AnotherFlushbarPlugin'

I yesterday upgraded to Flutter 2.0.6 and when I added web support to an existing project I am getting this error
lib/generated_plugin_registrant.dart:16:3: Error: Getter not found: 'AnotherFlushbarPlugin'.
AnotherFlushbarPlugin.registerWith(registrar);
I am using a dependency Flushbar thought it might be due to that I removed that package run flutter clean but no use the error is still there
Fixed the issue there was package Flushbar code in the yaml file, I removed the line "another_flushbar": ^1.10.10 to fix the issue

Some classes not found after upgrading flutter

I am preparing small demo application on flutter using AndroidStudio on ubuntu. Application was working fine, suddenly I upgraded my flutter by using flutter upgrade command.
Problem starts here when I am compiling the application again now the error generating on compile time is below:
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...
Resolving dependencies...
Gradle task 'assembleDebug'...
Compiler message:
lib/main.dart:214:43: Error: Getter not found: 'UTF8'.
var json = await response.transform(UTF8.decoder).join();
^^^^
lib/main.dart:216:61: Error: Getter not found: 'JSON'.
UserResponse userResponse = new UserResponse.fromJson(JSON.decode(json));
^^^^
Compiler failed on /home/akshay/AkshayRanosys/Flutter/RanoStack/rano_stack/lib/main.dart
Finished with error: Gradle task assembleDebug failed with exit code 1
As we can read in error message compiler is not able to find UTF8 class and JSON class.
I have tried with setting some http versions in my pubspec.yaml file as:
http: ^0.11.3+16 or http: ^0.12.0
But not able to resolve the error
Could any one can share their experiences regarding this stuck?
Seems you made quite a big update.
Several months ago when Dart 2 final was released, all SCREAMING_CASE const identifiers were changed to lowerCamelCase to comply with the Dart style guide. (they were marked as deprecated for quite some time before the old ones were finally removed)
utf8 instead of UTF8 and json instead of JSON (there is now also a jsonDecode)