last day (15 days later) » 

10:41
0
Q: Unexplained changes in flutter source code, preventing the application from running

Avarage cat enjoyerNote: While writing this question, I found the solution to it, but this has given rise to more questions, so for context don't skip the original question. Original question: I am getting this error when trying to run my flutter application: ../flutter/packages/flutter/lib/src/rendering/box.dart(2...

what does flutter --version show? also, does flutter doctor -v say anything interesting?
Version: Flutter 3.22.2 • channel stable • https://github.com/flutter/flutter.git Framework • revision 761747bfc5 (3 months ago) • 2024-06-05 22:15:13 +0200 Engine • revision edd8546116 Tools • Dart 3.4.3 • DevTools 2.34.3
Doctor: [!] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at C:\Users\hooph\AppData\Local\Android\sdk X cmdline-tools component is missing Run path/to/sdkmanager --install "cmdline-tools;latest"` See developer.android.com/studio/command-line for more details. X Android license status unknown. Run flutter doctor --android-licenses to accept the SDK licenses. See flutter.dev/docs/get-started/install/windows#android-setup for more details.` Everything else is okay
and now, if you use your flutter 3.22.2 and create a brand new project with flutter create foo what errors do you see in foo project?
The same: [!] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at C:\Users\hooph\AppData\Local\Android\sdk X cmdline-tools component is missing Run path/to/sdkmanager --install "cmdline-tools;latest" See developer.android.com/studio/command-line for more details. X Android license status unknown. Run flutter doctor --android-licenses to accept the SDK licenses. See flutter.dev/docs/get-started/install/windows#android-setup for more details.
what errors do you have in foo project (i am not asking about flutter doctor now)? what does flutter analyze show if you run it in the root of foo project?
10:41
No issues found
if no issues found, does it run as expected?
Yes, everything is fine
I was creating a flutter app, that stopped running, because there was an error in the flutter source code in flutter/packages/lib/src/rendering/box.dart. So my app was error free, but flutter source code had errors
in that application what do you have in pubspec.yaml in environment: sdk: '>=n.n.n <m.m.m' section? compare it with pubspec.yaml in running foo project and try the same numbers
environment: sdk: '>=3.4.3 <4.0.0'
in both applications?
10:41
yes, both are the same
tried flutter clean in the root of your application and restarting ide?
I get this error with flutter clean: Flutter failed to delete a directory at "build". The flutter tool cannot access the file or directory. Please ensure that the SDK and/or project is installed in a location that has read/write permissions for the current user.
remove build folder by hand then and run flutter clean again
Did that, then tried to run the application and got a bunch of errors like firebase_firestore.lib(7ba01613985f32fe50e0c125a0414f54_fire‌​base_firestore.dir_D‌​ebug_document_snapsh‌​ot.obj) : warning LNK4099: PDB '' was not found with 'firebase_firestore.lib(7ba01613985f32fe50e0c125a0414f54_fir‌​ebase_firestore.dir_‌​Debug_document_snaps‌​hot.obj)' or at ''; linking object as if no debug info and .C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.C‌​ppCommon.targets(166‌​,5): error MSB3073: :VCEnd" exited with code 1. .
and what does "flutter analyze" say in that application?
10:45
Well it basically dumped all the 459K errors in the terminal
It's still printing them
and what if you copy your entire "lib" folder to a "foo" project and "assets" and "pubspec.yaml"?
as you saw your flutter instalation is ok since foo app worked with no problems
the problem is in your application config
btw did "flutter clean" run with no errors?
so i copied everything over but now its not recognising some of my iomports
@pskink in which project
in project with problems
no
as i said before, it couldnt delete the build folder
did you copy dependencies from pubspec.yaml"?
so you cannot remove it "by hand"?
i reinstalled dependancies
now it works
@pskink i did
so what does not work now?
from my post:
This begs the question:

How was this null check even removed in the first place?
Why was dart code fixes preventing me from adding it back?
Why is the flutter source code full of errors and how does it still run?
some errors are also in the build.gradle file
does your app work now?
10:56
I got the app to run a long time a go. The thing is, I dont understand how such an error got into the source code by itself and why the source code is full of errors
11:10
you said: "i reinstalled dependancies
now it works" so whats the problem now?
do you still have lots of errors in flutter sdk code?
ok so in your "good" foo project type "RenderBox? rb;` and ctrl-click on "RenderBox" - it will show "box.dart" file - is it the same "box.dart" file you mentioned in your question?
in other words: does the "good" foo project also use the flutter sdk "with errors"?
Weirdly the path is the same but one shows errors and the other doesnt
so as i said copy all the sources to good project and remove that old bad one
and of course you dont have to modify box.dart as it is 100% ok
Oh well it looks like my C drive has run out of space
I will have to do some moving now
11:57
Ok, finally
I got everything to work again
thanks for everything
12:32
sure, your welcome, i hope you reverted changes in box.dart?
13:16
yes, its working now

last day (15 days later) »