Flutter Dev Tools not displaying correctly - dart

I'm new to Flutter & Dart and busy learning it.
My develop environment is xUbutu using VS Code with Flutter and Dart installed.
Flutter 2.10.1 • channel stable • https://github.com/flutter/flutter.git
Framework • revision db747aa133 (5 days ago) • 2022-02-09 13:57:35 -0600
Engine • revision ab46186b24
Tools • Dart 2.16.1 • DevTools 2.9.2
When running a simple app in debug mode and when I "Open DevTools in my Chrome browser", I get the following:
In VS Code, I'm able to scroll the complete widget tree:
My problem is that I do not get the complete widget tree in my Chrome browser and I can't scroll.
Regards,
Nols Smit

Related

[google_maps_flutter: ^2.1.1]. GMSx_CCTClearcutUploader crashIfNecessary

With google_maps_flutter: ^2.1.1 on iOS physical device, I have this console warning message:
Runner[15058[/0x1067e8580]()] [lvl=3]
+[GMSx_CCTClearcutUploader crashIfNecessary] Multiple instances of CCTClearcutUploader were instantiated.
Multiple uploaders function correctly but have an adverse affect on battery performance due to lock contention.
Flutter setup:
Flutter is already up to date on channel stable
Flutter 2.10.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 097d3313d8 (7 days ago) • 2022-02-18 19:33:08 -0600
Engine • revision a83ed0e5e3
Tools • Dart 2.16.1 • DevTools 2.9.2
Any idea how to fix it?

Flutter Firebase app runs fine in simulator but crashes when tested in testflight

Recently I've joined a project of a flutter app using firebase, and everything was fine until it comes to make the production builds. For Android it works fine. But for ios I'm facing a problem that in the simulator it runs without a problem but when I uploaded it to Testflight for my coworkers to test it immediately crashes when opened.
That's my flutter doctor -v:
[✓] Flutter (Channel unknown, 2.2.2, on macOS 11.2.3 20D91 darwin-x64, locale
pt-BR)
• Flutter version 2.2.2 at /Users/leonardofelix/flutter
• Framework revision d79295af24 (4 months ago), 2021-06-11 08:56:01 -0700
• Engine revision 91c9fc8fe0
• Dart version 2.13.3
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/leonardofelix/Library/Android/sdk
• Platform android-30, build-tools 30.0.3
• Java binary at: /Applications/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build
1.8.0_242-release-1644-b3-6915495)
! Some Android licenses not accepted. To resolve this, run: flutter doctor
--android-licenses
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.5.1, Build version 12E507
• CocoaPods version 1.10.0
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build
1.8.0_242-release-1644-b3-6915495)
[✓] VS Code (version 1.61.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.27.0
[✓] Connected device (2 available)
• iPhone 12 Pro Max (mobile) • 94BE45CC-ED04-4892-B3A6-3F43D0A147AD • ios
• com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
• Chrome (web) • chrome •
web-javascript • Google Chrome 94.0.4606.81
And the crash report that a tester of testflight sent to me:
crashlog.crash
I've already tested some things that I found googling, like add the Google-Services.plist again using xcode and verified if the schemas to the archive were pointing to release mode. But none of them worked.
If any additional data is needed, I'll be glad to provide. So thanks in advance for any help.
Well, I found the error. I had changed the Flutter version using git (thus, the Flutter folder is a git repository). When I changed the version, it left the cache from the other Flutter version, and that cache was causing the problem.
One thing that helped me to find this out was running the release build in a physical device using Xcode; there it prompt me the following error:
Error while initializing the Dart VM: Wrong full snapshot version, expected '9cf77f4405212c45daf608e1cd646852' found 'e4a09dbf2bb120fe4674e0576617a0dc'
And for that, I found a solution on the web. What I did was to remove the folder cache inside <yourFlutterDir>/bin and run the following commands in the Flutter directory:
git reset --hard
git clean -xffd
flutter doctor
And then, I went to my Flutter project folder, ran flutter clean, and finally flutter build ios.
So the project built successfully, and the app worked in iOS.

Flutter: After enabling web support... iOS simulators disappeared

I have followed below url and enabled web for my flutter application.
https://flutter.dev/docs/get-started/web
flutter channel master
flutter config --enable-web
flutter create .
flutter run -d chrome
flutter build web
Everything went well and I am able to launch my application on Web. However, after enabling web my ios simulators not appearing in devices list.
flutter devices
2 connected devices:
Chrome • chrome • web-javascript • Google Chrome 80.0.3955.4 dev
Web Server • web-server • web-javascript • Flutter Tools
Could someone help me to resolve this issue?
Here's my environment:
flutter --version
Flutter 1.10.15-pre.424 • channel master •
https://github.com/flutter/flutter.git
Framework • revision 289b458 (21 hours ago) • 2019-11-06 02:51:17 -0500
Engine • revision 9726b4cb99
Tools • Dart 2.7.0
dart --version
Dart VM version: 2.6.0 (Thu Oct 24 17:52:22 2019 +0200) on "macos_x64"
As discussed here https://github.com/flutter/flutter/issues/44326 I have updated my xcode from 9.4.1 to 11.2. Now the issue is fixed and I am able to see all devices.

dart:ui:1: Error: Not found: dart:ui. flutter/dart:

When I start a debugging session (pressing F5) I receive the following messages:
dart:ui:1: Error: Not found: dart:ui.
Exited (sigterm)
There is no indication as to where the problem occurred. Output from flutter doctor -v is:
[√] Flutter (Channel beta, v0.8.2, on Microsoft Windows [Version 6.1.7601], locale en-US)
• Flutter version 0.8.2 at C:\Downloads\flutter\flutter_windows_v0.5.1-beta\flutter
• Framework revision 5ab9e70727 (2 weeks ago), 2018-09-07 12:33:05 -0700
• Engine revision 58a1894a1c
• Dart version 2.1.0-dev.3.1.flutter-760a9690c2
[√] Android toolchain - develop for Android devices (Android SDK 27.0.3)
• Android SDK at C:\Users\gggustafson\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-27, build-tools 27.0.3
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
• All Android licenses accepted.
[√] Android Studio (version 3.1)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 26.0.1
• Dart plugin version 173.4700
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
[√] VS Code, 64-bit edition (version 1.25.1)
• VS Code at C:\Program Files\Microsoft VS Code
• Flutter extension version 2.18.0
[√] Connected devices (1 available)
• SM G925V • 06157df60c7a8e20 • android-arm64 • Android 7.0 (API 24)
• No issues found!
Any thoughts?
When running the app, you will find 2 main.dart
Choose the one with the flutter icon beside it
If you are running flutter project.
In edit configuration, run it as flutter project,which has a flutter icon besides it.
If you are testing a dart file
Check your denpendency tree. Delete all flutter related lib like widgets/material/cupertino.
Simple explaination
In short, you are running a file as dart file, but you have imported flutter dependencies like widgets/material at the same time. Either run it as flutter ,or get rid of flutter dependency and run pure dart.
Magically if you add:
import 'package:flutter/widgets.dart';
at the top of that file you want to Run or Debug, and delete the existing configuration, it will run as flutter instead of dart.
Why? Idea/Android Studio scans the file that you're asking to Run or Debug for flutter imports and uses that to decide whether the initial run configuration should be a dart or flutter one. If you import any flutter packages, you get a flutter run configuration.
Confusingly, it does this only the first time you Run/Debug that file, and remembers the run configuration.
If your run configuration was created as the wrong kind (Dart instead of Flutter), you'll need to go into the "Edit Configurations" menu to delete it, than are to Run/Debug that file again.
Its very confusing behavior, particularly since your imports are insufficient to know whether the file should be run as Flutter or plain old Dart -- your file's import may import another file that imports a flutter library. It may be detected as Dart, when Flutter it the right configuration.
They should have just added "Run Dart", "Run Flutter".
If you are using VS Code as your IDE then choose Start Debugging instead of Run Code and it will work.
While running choose the one with the flutter icon and it should help.
import this liberary
import 'dart:ui' as ui;

Flutter Error: The current Flutter SDK version is 2.1.0-dev.0.0.flutter-be6309690f

I've just upgraded my flutter, after upgradation I am unable to run any flutter project on my Android Studio. I am getting this error message.
The current Dart SDK version is 2.1.0-dev.0.0.flutter-be6309690f.
Because buddy depends on flutter_built_redux 0.4.5 which requires SDK
version >=1.19.0 <2.0.0, version solving failed.
pub get failed (1)
How can I downgrade Dart or how can I resolve this issue, I am running android studio on mac.
I've tried by changing flutter channels dev and master but it doesn't make a difference.
flutter doctor -v result:
[✓] Flutter (Channel dev, v0.6.0, on Mac OS X 10.13.4 17E202, locale en-IN)
• Flutter version 0.6.0 at /Users/pro/Downloads/flutter
• Framework revision 9299c02cf7 (5 days ago), 2018-08-16 00:35:12 +0200
• Engine revision e3687f70c7
• Dart version 2.1.0-dev.0.0.flutter-be6309690f
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
• Android SDK at /Users/pro/Library/Android/sdk
• Android NDK location not configured (optional; useful for native
profiling support)
• Platform android-27, build-tools 27.0.3
• Java binary at: /Applications/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-
1024-b01)
• All Android licenses accepted.
[✓] iOS toolchain - develop for iOS devices (Xcode 9.4.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 9.4.1, Build version 9F2000
• ios-deploy 1.9.2
• CocoaPods version 1.5.0
[✓] Android Studio (version 3.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 27.1.1
• Dart plugin version 173.4700
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
[!] Connected devices
! No devices available
flutter_built_redux package doesn't met the flutter dependency.
The error is caused by package not by flutter sdk.
see here
https://github.com/davidmarne/flutter_built_redux/blob/master/pubspec.yaml#L22
AND
you can post issue on flutter_built_redux package using this link
https://github.com/davidmarne/flutter_built_redux/issues/new?title=support%20for%20flutter%20sdk%202.1.0.dev&body=please%20upgrade%20the%20package%20for%20new%20flutter%20releases
Flutter includes a bundled Dart SDK (under its bin/cache directory) pinned to the same version used in the engine that we compile into your shipping iOS/Android app. As such, the only way to use Flutter with a different version of Dart is to use an older version of Flutter.
To do this, cd to the Flutter SDK directory. You can list the available versions by running git tag. To switch to a version, use git checkout. For example, to switch to v0.8.1 you’d run git checkout v0.8.1. When you’d like to switch back to the beta channel, run git checkout beta.
That said, generally I’d advise you to stick to beta and file an issue (or send a pull request) to the maintainer of any packages that haven’t yet been updated to Dart 2. You may also want to check the dependencies listed in your pubspec.yaml to see if there are newer versions available on pub.dartlang.org. It may just be a matter of updating your dependencies to a newer version.
I guess this is an quiver package dependency problem. Once in an update i had face same issue. That time i solve this by adding this lines to pubspec.yaml
dependency_overrides:
quiver: ^2.0.0+1
Flutter has the following channels, in increasing order of stability:
master
dev
beta
stable
Generally, I’d advise you to stick to the beta it works fine with all the packages.
It's not necessary but i think you should have to install Android Studio again with latest version.then add flutter and dart plugin there then Add Flutter SDK path in settings>Plugins>Flutter>Sdk-Path so locate your flutter sdk that you have installed in your PC may be located at C so add that path.And it may work.
And must have latest Flutter and Dart SDK installed.
You can download flutter SDK from here:
https://flutter.dev/docs/development/tools/sdk/releases

Resources