Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Framework components are not found when re-building project on other target platforms without cleaning #145889

Closed
dumabg opened this issue Mar 28, 2024 · 18 comments
Labels
a: build Building flutter applications with the tool a: desktop Running on desktop found in release: 3.19 Found to occur in 3.19 found in release: 3.22 Found to occur in 3.22 fyi-desktop For the attention of Desktop platforms team has reproducible steps The issue has been confirmed reproducible and is ready to work on r: invalid Issue is closed as not valid team-tool Owned by Flutter Tool team tool Affects the "flutter" command-line tool. See also t: labels.

Comments

@dumabg
Copy link

dumabg commented Mar 28, 2024

Steps to reproduce

  • Create a test project: flutter create test --platforms=windows,linux
  • Add the package package_info_plus: flutter pub add package_info_plus
  • On Linux, build the project: flutter build linux
  • On Windows, build the project: flutter build windows

Expected results

Build the windows aplication

Actual results

Gives the error:
PathExistsException: PathExistsException: Cannot create link, path = 'D:\temp\test\test\linux\flutter\ephemeral.plugin_symlinks\package_info_plus' (OS Error: No se puede crear un archivo que ya existe.)

If a new project is created on Windows, only with the windows platform, and the code is copied, the build works and creates the application.

Code sample

The default code generated by create, plus a pub add of package_info_plus

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs


#0      _Link.throwIfError (dart:io/link.dart:339:7)
#1      _Link.createSync (dart:io/link.dart:267:5)
#2      ForwardingLink.createSync (package:file/src/forwarding/forwarding_link.dart:20:16)
#3      ForwardingLink.createSync (package:file/src/forwarding/forwarding_link.dart:20:16)
#4      _createPlatformPluginSymlinks (package:flutter_tools/src/flutter_plugins.dart:1090:12)
#5      createPluginSymlinks (package:flutter_tools/src/flutter_plugins.dart:1019:5)
#6      buildWindows (package:flutter_tools/src/windows/build_windows.dart:79:3)
#7      BuildWindowsCommand.runCommand (package:flutter_tools/src/commands/build_windows.dart:56:11)
<asynchronous suspension>
#8      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1389:27)
<asynchronous suspension>
#9      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#10     CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
#11     FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:355:9)
<asynchronous suspension>
#12     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#13     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:295:5)
<asynchronous suspension>
#14     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:119:9)
<asynchronous suspension>
#15     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#16     main (package:flutter_tools/executable.dart:90:3)
<asynchronous suspension>

Flutter Doctor output


[32m[✓]�[39m Flutter (Channel stable, 3.19.4, on Microsoft Windows [Versi¢n 10.0.22631.3007], locale es-ES)
    �[32m•�[39m Flutter version 3.19.4 on channel stable at D:\programacio\flutter_win\flutter
    �[32m•�[39m Upstream repository https://github.com/flutter/flutter.git
    �[32m•�[39m Framework revision 68bfaea224 (8 days ago), 2024-03-20 15:36:31 -0700
    �[32m•�[39m Engine revision a5c24f538d
    �[32m•�[39m Dart version 3.3.2
    �[32m•�[39m DevTools version 2.31.1

�[32m[✓]�[39m Windows Version (Installed version of Windows is version 10 or higher)

�[31m[✗]�[39m Android toolchain - develop for Android devices
    �[31m✗�[39m Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.


�[31m[✗]�[39m Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
    �[33m!�[39m Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

�[32m[✓]�[39m Visual Studio - develop Windows apps (Visual Studio Community 2022 17.9.5)
    �[32m•�[39m Visual Studio at D:\programacio\flutter_win\vs
    �[32m•�[39m Visual Studio Community 2022 version 17.9.34723.18
    �[32m•�[39m Windows 10 SDK version 10.0.22621.0

�[33m[!]�[39m Android Studio (not installed)
    �[32m•�[39m Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).

�[32m[✓]�[39m VS Code (version 1.65.0)
    �[32m•�[39m VS Code at C:\Users\mabg\AppData\Local\Programs\Microsoft VS Code
    �[32m•�[39m Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

�[32m[✓]�[39m Connected device (2 available)
    �[32m•�[39m Windows (desktop) • windows • windows-x64    • Microsoft Windows [Versi¢n 10.0.22631.3007]
    �[32m•�[39m Edge (web)        • edge    • web-javascript • Microsoft Edge 122.0.2365.92

�[32m[✓]�[39m Network resources
    �[32m•�[39m All expected network resources are available.

�[33m!�[39m Doctor found issues in 3 categories.

@darshankawar darshankawar added the in triage Presently being triaged by the triage team label Mar 28, 2024
@darshankawar
Copy link
Member

  • Add the package package_info_plus: flutter pub add package_info_plus

@dumabg This is a community package. Can you try with Flutter's first party package and check if you still get similar error for it ?

Also, is your project on a mounted Windows file system ?

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Mar 28, 2024
@dumabg
Copy link
Author

dumabg commented Mar 28, 2024

  • Add the package package_info_plus: flutter pub add package_info_plus

@dumabg This is a community package. Can you try with Flutter's first party package and check if you still get similar error for it ?

What is "first party package"?

Also, is your project on a mounted Windows file system ?

Yes

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Mar 28, 2024
@darshankawar
Copy link
Member

What is "first party package"?

The packages that are developed by Flutter team. See the list for your reference and take any one of it (ex: camera, video_player or image_picker) and see if using it, you get same error or not.

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Mar 28, 2024
@dumabg
Copy link
Author

dumabg commented Mar 28, 2024

I removed package_info_plus and add image_picker.
It gives another error. It seems that is using the linux configuration. The /opt/flutter directory is configured in Linux.



`lib/main.dart(1,8): error GFAA2A68C: Error when reading '/opt/flutter/packages/flutter/lib/material.dart': El sistema no puede encontrar la ruta especificada. [D:\temp\test\test\build\windows\x64\flutter\flutter_assemble.vcxproj]
lib/main.dart(7,21): error G5FE39F1E: Type 'StatelessWidget' not found. [D:\temp\test\test\build\windows\x64\flutter\flutter_assemble.vcxproj]
lib/main.dart(12,3): error G5FE39F1E: Type 'Widget' not found. [D:\temp\test\test\build\windows\x64\flutter\flutter_assemble.vcxproj]
lib/main.dart(12,16): error G5FE39F1E: Type 'BuildContext' not found. [D:\temp\test\test\build\windows\x64\flutter\flutter_assemble.vcxproj]
lib/main.dart(39,26): error G5FE39F1E: Type 'StatefulWidget' not found. [D:\temp\test\test\build\windows\x64\flutter\flutter_assemble.vcxproj]
lib/main.dart(54,3): error G5FE39F1E: Type 'State' not found. [D:\temp\test\test\build\windows\x64\flutter\flutter_assemble.vcxproj]
lib/main.dart(57,32): error G5FE39F1E: Type 'State' not found. [D:\temp\test\test\build\windows\x64\flutter\flutter_assemble.vcxproj]
lib/main.dart(72,3): error G5FE39F1E: Type 'Widget' not found. [D:\temp\test\test\build\windows\x64\flutter\flutter_assemble.vcxproj]
lib/main.dart(72,16): error G5FE39F1E: Type 'BuildContext' not found. [D:\temp\test\test\build\windows\x64\flutter\flutter_assemble.vcxproj]
lib/main.dart(8,9): error GB23DA612: The superclass, 'StatelessWidget', has no unnamed constructor that takes no arguments. [D:\temp\test\test\build\windows\x64\flutter\flutter_assemble.vcxproj]
lib/main.dart(40,9): error GB23DA612: The superclass, 'StatefulWidget', has no unnamed constructor that takes no arguments. [D:\temp\test\test\build\windows\x64\flutter\flutter_assemble.vcxproj]
lib/main.dart(4,3): error G311314CC: Method not found: 'runApp'. [D:\temp\test\test\build\windows\x64\flutter\flutter_assemble.vcxproj]
lib/main.dart(12,16): error G3498BE69: 'BuildContext' isn't a type. [D:\temp\test\test\build\windows\x64\flutter\flutter_assemble.vcxproj]
lib/main.dart(13,12): error GE5CFE876: The method 'MaterialApp' isn't defined for the class 'MyApp'. [D:\temp\test\test\build\windows\x64\flutter\flutter_assemble.vcxproj]
lib/main.dart(15,14): error GE5CFE876: The method 'ThemeData' isn't defined for the class 'MyApp'. [D:\temp\test\test\build\windows\x64\flutter\flutter_assemble.vcxproj]
lib/main.dart(31,22): error G4127D1E8: The getter 'ColorScheme' isn't defined for the class 'MyApp'. [D:\temp\test\test\build\windows\x64\flutter\flutter_assemble.vcxproj]
lib/main.dart(31,54): error G4127D1E8: The getter 'Colors' isn't defined for the class 'MyApp'. [D:\temp\test\test\build\windows\x64\flutter\flutter_assemble.vcxproj]
lib/main.dart(61,5): error GE5CFE876: The method 'setState' isn't defined for the class '_MyHomePageState'. [D:\temp\test\test\build\windows\x64\flutter\flutter_assemble.vcxproj]
lib/main.dart(72,16): error G3498BE69: 'BuildContext' isn't a type. [D:\temp\test\test\build\windows\x64\flutter\flutter_assemble.vcxproj]
lib/main.dart(107,22): error GEDBAFD0E: 'Widget' isn't a type. [D:\temp\test\test\build\windows\x64\flutter\flutter_assemble.vcxproj]
lib/main.dart(108,19): error GF7CA4DBF: Couldn't find constructor 'Text'. [D:\temp\test\test\build\windows\x64\flutter\flutter_assemble.vcxproj]
lib/main.dart(121,27): error GC9768DF9: Undefined name 'Icons'. [D:\temp\test\test\build\windows\x64\flutter\flutter_assemble.vcxproj]
lib/main.dart(121,22): error GF7CA4DBF: Couldn't find constructor 'Icon'. [D:\temp\test\test\build\windows\x64\flutter\flutter_assemble.vcxproj]
lib/main.dart(79,12): error GE5CFE876: The method 'Scaffold' isn't defined for the class '_MyHomePageState'. [D:\temp\test\test\build\windows\x64\flutter\flutter_assemble.vcxproj]
lib/main.dart(80,15): error GE5CFE876: The method 'AppBar' isn't defined for the class '_MyHomePageState'. [D:\temp\test\test\build\windows\x64\flutter\flutter_assemble.vcxproj]
lib/main.dart(84,26): error G4127D1E8: The getter 'Theme' isn't defined for the class '_MyHomePageState'. [D:\temp\test\test\build\windows\x64\flutter\flutter_assemble.vcxproj]
lib/main.dart(87,16): error GE5CFE876: The method 'Text' isn't defined for the class '_MyHomePageState'. [D:\temp\test\test\build\windows\x64\flutter\flutter_assemble.vcxproj]
lib/main.dart(87,21): error G4127D1E8: The getter 'widget' isn't defined for the class '_MyHomePageState'. [D:\temp\test\test\build\windows\x64\flutter\flutter_assemble.vcxproj]
lib/main.dart(89,13): error GE5CFE876: The method 'Center' isn't defined for the class '_MyHomePageState'. [D:\temp\test\test\build\windows\x64\flutter\flutter_assemble.vcxproj]
lib/main.dart(92,16): error GE5CFE876: The method 'Column' isn't defined for the class '_MyHomePageState'. [D:\temp\test\test\build\windows\x64\flutter\flutter_assemble.vcxproj]
lib/main.dart(106,30): error G4127D1E8: The getter 'MainAxisAlignment' isn't defined for the class '_MyHomePageState'. [D:\temp\test\test\build\windows\x64\flutter\flutter_assemble.vcxproj]
lib/main.dart(111,13): error GE5CFE876: The method 'Text' isn't defined for the class '_MyHomePageState'. [D:\temp\test\test\build\windows\x64\flutter\flutter_assemble.vcxproj]
lib/main.dart(113,22): error G4127D1E8: The getter 'Theme' isn't defined for the class '_MyHomePageState'. [D:\temp\test\test\build\windows\x64\flutter\flutter_assemble.vcxproj]
lib/main.dart(118,29): error GE5CFE876: The method 'FloatingActionButton' isn't defined for the class '_MyHomePageState'. [D:\temp\test\test\build\windows\x64\flutter\flutter_assemble.vcxproj]
D:\programacio\flutter_win\vs\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(254,5): error MSB8066: Custom build for 'D:\temp\test\test\build\windows\x64\CMakeFiles\9808f3fe5c503be3f34803371effa3ff\flutter_windows.dll.rule;D:\temp\test\test\build\windows\x64\CMakeFiles\37d7ac0acd1e1bdea84b965797f47011\flutter_assemble.rule' exited with code 1. [D:\temp\test\test\build\windows\x64\flutter\flutter_assemble.vcxproj]
Build process failed.`


@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Mar 28, 2024
@darshankawar
Copy link
Member

darshankawar commented Apr 1, 2024

[D:\temp\test\test\

Can you try this on any other location / path (drive) and check if you get same result or not ?

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 1, 2024
@dumabg
Copy link
Author

dumabg commented Apr 1, 2024

It seems that is using the last compilation configuration.

I done the inverse operation. First compile in windows and after in linux. The error in this case is in linux, trying to find the libraries in the windows configuration.

flutter build linux

Command exited with code 128: git fetch --tags
Standard error: fatal: no es posible acceder a 'https://github.com/flutter/flutter.git/': GnuTLS recv error (-110): The TLS connection was non-properly
terminated.

ERROR: lib/main.dart:1:8: Error: Error when reading '/D:/programacio/flutter_win/flutter/packages/flutter/lib/material.dart': No such file or directory
ERROR: import 'package:flutter/material.dart';
ERROR:        ^
ERROR: lib/main.dart:7:21: Error: Type 'StatelessWidget' not found.
ERROR: class MyApp extends StatelessWidget {
ERROR:                     ^^^^^^^^^^^^^^^
ERROR: lib/main.dart:12:3: Error: Type 'Widget' not found.
ERROR:   Widget build(BuildContext context) {
ERROR:   ^^^^^^
ERROR: lib/main.dart:12:16: Error: Type 'BuildContext' not found.
ERROR:   Widget build(BuildContext context) {
ERROR:                ^^^^^^^^^^^^
ERROR: lib/main.dart:39:26: Error: Type 'StatefulWidget' not found.
ERROR: class MyHomePage extends StatefulWidget {

Doing flutter clean and after flutter build linux, it works.

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 1, 2024
@darshankawar
Copy link
Member

I done the inverse operation. First compile in windows and after in linux. The error in this case is in linux, trying to find the libraries in the windows configuration.

Are you running WSL setup ?

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 2, 2024
@dumabg
Copy link
Author

dumabg commented Apr 2, 2024

No. I have a dual boot. The drive with the projects is in a windows partition.

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 2, 2024
@huycozy
Copy link
Member

huycozy commented Apr 3, 2024

@dumabg I wonder how you build linux target when you are on Windows host. Do you have any additional setup on the project/Flutter SDK?

On my end, it outputs the message below (""build linux" only supported on Linux hosts"):

PS C:\Users\ADMIN\Desktop\repro_stable> flutter build windows

Building Windows application...                                    51.1s
√  Built build\windows\x64\runner\Release\repro_stable.exe (0.1MB).

PS C:\Users\ADMIN\Desktop\repro_stable> flutter build linux
"build linux" only supported on Linux hosts.

My PC is also dual boot too (Windows and Ubuntu distro).


GnuTLS recv error (-110): The TLS connection was non-properly

This error seems to be an issue with Git, could you check this and the underlying comment to see if it helps?

@huycozy huycozy added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 3, 2024
@dumabg
Copy link
Author

dumabg commented Apr 3, 2024

@dumabg I wonder how you build linux target when you are on Windows host. Do you have any additional setup on the project/Flutter SDK?

On my end, it outputs the message below (""build linux" only supported on Linux hosts"):

PS C:\Users\ADMIN\Desktop\repro_stable> flutter build windows

Building Windows application...                                    51.1s
√  Built build\windows\x64\runner\Release\repro_stable.exe (0.1MB).

PS C:\Users\ADMIN\Desktop\repro_stable> flutter build linux
"build linux" only supported on Linux hosts.

My PC is also dual boot too (Windows and Ubuntu distro).

GnuTLS recv error (-110): The TLS connection was non-properly

This error seems to be an issue with Git, could you check this and the underlying comment to see if it helps?

I build de Linux project on Linux and the Windows project on Windows, but using the same directory project in the same disk.

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 3, 2024
@huycozy
Copy link
Member

huycozy commented Apr 3, 2024

the same directory project in the same disk

I see, you are using the sample project located on a partition but linking/using the different Flutter SDK directory, right? Could you also share flutter doctor -v on Linux? (If this is your current setup, I will give it a try on my end)

@huycozy huycozy added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 3, 2024
@dumabg
Copy link
Author

dumabg commented Apr 3, 2024

Yes. On Linux is installed the Flutter SDK for Linux. On Windows is installed the Flutter SDK for Windows.

This is the flutter doctor for Linux:

`[✓] Flutter (Channel stable, 3.19.4, on KDE neon 6.0 6.5.0-26-generic, locale es_ES.UTF-8)
• Flutter version 3.19.4 on channel stable at /opt/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 68bfaea (hace 2 semanas), 2024-03-20 15:36:31 -0700
• Engine revision a5c24f538d
• Dart version 3.3.2
• DevTools version 2.31.1

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /opt/android-sdk/
• Platform android-34, build-tools 34.0.0
• Java binary at: /opt/android-studio/jbr/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
• All Android licenses accepted.

[✓] Chrome - develop for the web
• Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
• Ubuntu clang version 14.0.0-1ubuntu1.1
• cmake version 3.29.0
• ninja version 1.10.1
• pkg-config version 0.29.2

[!] Android Studio (version unknown)
• Android Studio at /opt/android-studio
• 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
✗ Unable to determine Android Studio version.
• Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)

[✓] VS Code (version 1.87.2)
• VS Code at /usr/share/code
• Flutter extension version 3.86.0

[✓] Connected device (2 available)
• Linux (desktop) • linux • linux-x64 • KDE neon 6.0 6.5.0-26-generic
• Chrome (web) • chrome • web-javascript • Google Chrome 123.0.6312.105

[✓] Network resources
• All expected network resources are available.
`

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 3, 2024
@huycozy
Copy link
Member

huycozy commented Apr 4, 2024

@dumabg Thank you for the response. I can reproduce issue mentioned at #145889 (comment) and #145889 (comment) as well (framework components are not found).

flutter doctor -v
[✓] Flutter (Channel stable, 3.19.5, on Ubuntu 22.04.3 LTS 6.5.0-26-generic, locale en_US.UTF-8)
    • Flutter version 3.19.5 on channel stable at /home/huynq/Documents/Working/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 300451adae (7 days ago), 2024-03-27 21:54:07 -0500
    • Engine revision e76c956498
    • Dart version 3.3.3
    • DevTools version 2.31.1

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0-rc3)
    • Android SDK at /home/huynq/Android/Sdk/
    • Platform android-33, build-tools 34.0.0-rc3
    • Java binary at: /snap/android-studio/current/jbr/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • Ubuntu clang version 14.0.0-1ubuntu1.1
    • cmake version 3.22.1
    • ninja version 1.10.1
    • pkg-config version 0.29.2

[✓] Android Studio (version 2021.1)
    • Android Studio at /home/huynq/Documents/android-studio
    • Flutter plugin version 67.0.1
    • Dart plugin version 211.7817
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)

[!] Android Studio (version unknown)
    • Android Studio at /snap/android-studio/current
    • 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
    ✗ Unable to determine Android Studio version.
    • android-studio-dir = /snap/android-studio/current
    • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)

[✓] VS Code (version 1.84.2)
    • VS Code at /usr/share/code
    • Flutter extension version 3.84.0

[✓] VS Code (version 1.87.2)
    • VS Code at /snap/code/current/usr/share/code
    • Flutter extension version 3.84.0

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Ubuntu 22.04.3 LTS 6.5.0-26-generic
    • Chrome (web)    • chrome • web-javascript • Google Chrome 120.0.6099.199

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

It looks like an issue with Flutter tool. If we build/run app on Windows, then build/run on the same project on Linux, issue appears; and vice versa. Flutter tool seems to look up/re-use (cache?) when starting build/run on the remaining target platform (Linux and Windows in this case for e.g).

But if we do flutter clean and flutter pub get again each time switching to other OS, that issue will not occur. Also, the issue can be reproduced without adding a plugin (tried with image_picker then also removed it) so I think it's not a package/plugin-specific issue.

For the original issue PathExistsException with package_info_plus package, it's a community package and is not maintained by Flutter repository, so I would suggest you open another issue to its developers for better support there even though the root cause could be the same to the 2nd issue here (I'm unsure about this).

I would keep this as a Flutter tool issue (2nd issue). Do you find it appropriate?

@huycozy huycozy added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 4, 2024
@dumabg
Copy link
Author

dumabg commented Apr 4, 2024

@dumabg Thank you for the response. I can reproduce issue mentioned at #145889 (comment) and #145889 (comment) as well (framework components are not found).
flutter doctor -v

It looks like an issue with Flutter tool. If we build/run app on Windows, then build/run on the same project on Linux, issue appears; and vice versa. Flutter tool seems to look up/re-use (cache?) when starting build/run on the remaining target platform (Linux and Windows in this case for e.g).

But if we do flutter clean and flutter pub get again each time switching to other OS, that issue will not occur. Also, the issue can be reproduced without adding a plugin (tried with image_picker then also removed it) so I think it's not a package/plugin-specific issue.

For the original issue PathExistsException with package_info_plus package, it's a community package and is not maintained by Flutter repository, so I would suggest you open another issue to its developers for better support there even though the root cause could be the same to the 2nd issue here (I'm unsure about this).

I would keep this as a Flutter tool issue (2nd issue). Do you find it appropriate?

Yes

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 4, 2024
@huycozy
Copy link
Member

huycozy commented Apr 5, 2024

Thanks. The issue is also reproduced on Flutter master channel. I will change the issue's title as well.

flutter doctor -v (stable & master)
[√] Flutter (Channel stable, 3.19.5, on Microsoft Windows [Version 10.0.19045.4170], locale en-US)
    • Flutter version 3.19.5 on channel stable at C:\WIP\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 300451adae (6 days ago), 2024-03-27 21:54:07 -0500
    • Engine revision e76c956498
    • Dart version 3.3.3
    • DevTools version 2.31.1

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\AndroidSDK
    • Platform android-34, build-tools 34.0.0
    • Java binary at: C:\Program Files\Android\Android Studio Hedgehog\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-b2043.56-10550314)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.4.4)
    • Visual Studio at D:\DOWNLOADWORK\VS2022
    • Visual Studio Community 2022 version 17.4.33213.308
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2022.3)
    • Android Studio at C:\Program Files\Android\Android StudioGiraffe
    • 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 17.0.6+0-b2043.56-10027231)

[√] Android Studio (version 2023.1)
    • Android Studio at C:\Program Files\Android\Android Studio Hedgehog
    • 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 17.0.7+0-b2043.56-10550314)

[√] VS Code (version 1.87.2)
    • VS Code at C:\Users\ADMIN\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.84.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19045.4170]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 123.0.6312.86
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 121.0.2277.83

[√] Network resources
    • All expected network resources are available.

• No issues found!
[!] Flutter (Channel master, 3.22.0-5.0.pre.27, on Microsoft Windows [Version 10.0.19045.4170], locale en-US)
    • Flutter version 3.22.0-5.0.pre.27 on channel master at C:\WIP\flutter_master
    ! Warning: `flutter` on your path resolves to C:\WIP\flutter\bin\flutter, which is not inside your current Flutter SDK checkout at C:\WIP\flutter_master.
      Consider adding C:\WIP\flutter_master\bin to the front of your path.
    ! Warning: `dart` on your path resolves to C:\WIP\flutter\bin\dart, which is not inside your current Flutter SDK checkout at C:\WIP\flutter_master.
      Consider adding C:\WIP\flutter_master\bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 9c6fcdac6f (in the future), 2024-04-05 02:19:12 +0200
    • Engine revision d44462a42d
    • Dart version 3.5.0 (build 3.5.0-18.0.dev)
    • DevTools version 2.34.1
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\AndroidSDK
    • Platform android-34, build-tools 34.0.0
    • Java binary at: C:\Program Files\Android\Android Studio Hedgehog\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-b2043.56-10550314)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.4.4)
    • Visual Studio at D:\DOWNLOADWORK\VS2022
    • Visual Studio Community 2022 version 17.4.33213.308
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2022.3)
    • Android Studio at C:\Program Files\Android\Android StudioGiraffe
    • 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 17.0.6+0-b2043.56-10027231)

[√] Android Studio (version 2023.1)
    • Android Studio at C:\Program Files\Android\Android Studio Hedgehog
    • 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 17.0.7+0-b2043.56-10550314)

[√] VS Code (version 1.87.2)
    • VS Code at C:\Users\ADMIN\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.86.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19045.4170]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 123.0.6312.106
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 121.0.2277.83

[√] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

@huycozy huycozy changed the title PathExistsException on build windows when a project has linux too Framework components are not found when re-building project on other target platforms without cleaning Apr 5, 2024
@huycozy huycozy added tool Affects the "flutter" command-line tool. See also t: labels. a: desktop Running on desktop a: build Building flutter applications with the tool has reproducible steps The issue has been confirmed reproducible and is ready to work on fyi-desktop For the attention of Desktop platforms team team-tool Owned by Flutter Tool team found in release: 3.19 Found to occur in 3.19 found in release: 3.22 Found to occur in 3.22 and removed in triage Presently being triaged by the triage team labels Apr 5, 2024
@christopherfujino
Copy link
Member

@dumabg thanks for filing this bug. As I understand it, you are trying to build a Flutter project from the same directory under multiple operating systems, is that correct?

If so, that is not supported, and practically speaking we will never support this workflow, as there are too many assumptions in the existing tooling that this workflow violates. I have filed the tracking issue: #146526 to have the tool check for this case and throw a helpful message.

In the case where you are dual booting Windows and Linux, I recommend that you have two versions of your project, and exclusively use each from a single operating system.

@huycozy huycozy added the r: invalid Issue is closed as not valid label Apr 10, 2024
@dumabg
Copy link
Author

dumabg commented Apr 10, 2024

@dumabg thanks for filing this bug. As I understand it, you are trying to build a Flutter project from the same directory under multiple operating systems, is that correct?

Yes.

If so, that is not supported, and practically speaking we will never support this workflow, as there are too many assumptions in the existing tooling that this workflow violates.

I have a lot of projects than are compiled for web, Linux, Android at the same directory project without problems. Only occurs with Windows.

I have filed the tracking issue: #146526 to have the tool check for this case and throw a helpful message.

In the case where you are dual booting Windows and Linux, I recommend that you have two versions of your project, and exclusively use each from a single operating system.

Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: build Building flutter applications with the tool a: desktop Running on desktop found in release: 3.19 Found to occur in 3.19 found in release: 3.22 Found to occur in 3.22 fyi-desktop For the attention of Desktop platforms team has reproducible steps The issue has been confirmed reproducible and is ready to work on r: invalid Issue is closed as not valid team-tool Owned by Flutter Tool team tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

No branches or pull requests

4 participants