Open Junkmer opened 1 month ago
@Junkmer
Looking at the error you are getting, it may be related to your local pub cache and not in the plugin itself. Looks like damaged pub cache, where package versions are missing files in your cache. Try running flutter pub cache repair
to see if it helps or not.
Ok, I will try to run it later and check it. Thank you very much
I tried it according to your suggestion, but found it was not successful, the same error was still reported, and there would be an error when adding any third-party library
PS D:\xxxx\FlutterProjects\self-project\test-flutter-project> flutter clean
Deleting build... 8ms
Deleting .dart_tool... 1ms
Deleting Generated.xcconfig... 0ms
Deleting flutter_export_environment.sh... 0ms
Deleting ephemeral... 0ms
Deleting ephemeral... 0ms
Deleting ephemeral... 0ms
Deleting .flutter-plugins-dependencies... 0ms
Deleting .flutter-plugins... 0ms
PS D:\xxxx\FlutterProjects\self-project\test-flutter-project> flutter pub cache repair
Reinstalled 660 packages.
PS D:\xxxx\FlutterProjects\self-project\test-flutter-project> flutter pub get
Resolving dependencies...
Downloading packages...
async 2.11.0 (2.12.0 available)
boolean_selector 2.1.1 (2.1.2 available)
characters 1.3.0 (1.3.1 available)
collection 1.19.0 (1.19.1 available)
fake_async 1.3.1 (1.3.2 available)
flutter_lints 3.0.2 (5.0.0 available)
js 0.6.7 (0.7.1 available)
leak_tracker 10.0.5 (10.0.8 available)
leak_tracker_flutter_testing 3.0.5 (3.0.9 available)
lints 3.0.0 (5.1.0 available)
matcher 0.12.16+1 (0.12.17 available)
material_color_utilities 0.11.1 (0.12.0 available)
meta 1.15.0 (1.16.0 available)
path 1.9.0 (1.9.1 available)
path_provider_android 2.2.10 (2.2.12 available)
stack_trace 1.11.1 (1.12.0 available)
string_scanner 1.3.0 (1.4.0 available)
vm_service 14.2.4 (14.3.1 available)
Got dependencies!
18 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.
PS D:\xxxx\FlutterProjects\self-project\test-flutter-project> flutter run -d windows
Launching lib\main.dart on Windows in debug mode...
CMake Error at flutter/generated_plugins.cmake:15 (add_subdirectory):
add_subdirectory given source
"flutter/ephemeral/.plugin_symlinks/tencent_cloud_chat_sdk/windows" which
is not an existing directory.
Call Stack (most recent call first):
CMakeLists.txt:59 (include)
Building Windows application... 4.0s
Error: Unable to generate build files
@Junkmer Is it only occuring while trying to add the said third party package or any third party package results in same error ?
That's right. Just add any plugin and you'll get the same error.
I wonder if there is something wrong with my cmake, but I am running the im Android project with the cmake configuration as normal
This problem has been bothering me for a few days, I tried to upgrade the windows system, upgrade the Flutter version, upgrade the cmake version and couldn't solve it
If you have any points that you might suspect, just bring them up, I try as much as I can, I look up similar anomalies online, and there is no solution I want
This is the only one similar to mine, I have tried it, neither Powershell nor cmd will work
Also run vs code, same error
Currently on an unknown channel. Run
flutter channel
to switch to an official channel.
Can you switch to official channel as suggested and try again to check if it still persist ?
Still no
Processor 12th Gen Intel(R) Core(TM) i5-12400F 2.50GHz Machine with RAM 16.0GB (15.8GB available) System Type 64-bit operating system based on x64 processor Pen and Touch There is no pen or touch input available for this display
Version Windows 11 Professional Edition Version number 23H2 Installation date: 2023/10/3 Operating system version 22631.4317 Experience Windows Feature Experience Pack 1000.22700.1041.0
Can you provide content of flutter/.pub-cache/hosted/pub.dartlang.org/tencent_cloud_chat_sdk/
?
If you try to add Flutter's first party plugin (ex: video_player, image_picker) to see if you still get same error ?
The cause of the problem has been found, the permission problem. The flutter cmake script in Android studio cannot be executed successfully because of the permission problem of Powershell in Android studio. When I select "Start Android Studio as administrator", Execute flutter run -d windows running successfully, in order to prevent others encounter, here hope flutter official can fix or add the next description
@Junkmer Flutter needs to be installed in a directory where the current user has write permissions so make sure the path where you have installed Flutter has proper / required permissions. Also, check if this is helpful or not and make sure you have installed the sdk properly per https://docs.flutter.dev/get-started/install/windows/desktop
Thanks, I'll try changing it.
Running Android studio as an administrator can
Does this happen if you run Flutter from a singular Powershell session (without being embedded inside any IDE)? Can you confirm you have installed the sdk properly as mentioned above?
No, unless I run it as an administrator.
Thanks for the update. But I would like to confirm more about plugins you added:
windows
directory at https://github.com/TencentCloud/chat-sdk-flutter/tree/main/tencent_im_sdk_plugin`.windows
directory at https://github.com/bitsdojo/bitsdojo_window/tree/master/bitsdojo_window_windowsCould you also test with our 1st party plugin (path_provider for eg which supports windows platform)? Thanks a lot! [^1]
[^1]: Please provide the information (output logs) in text format instead of a screenshot for better readability and investigation, see avoid posting screenshots of text.
OK, I'll try it at night
Adding path_provider can run successfully, but adding tencent_cloud_chat_sdk or bitsdojo_window still cannot run
but adding tencent_cloud_chat_sdk or bitsdojo_window still cannot run
These are third party plugins. Please reach out in their dedicated repo to know if there's an issue with them or not.
I don't quite understand. If it's a problem with the third-party library, why can it be run as an administrator? And only my Windows 11 has the problem, while others have no problem, and my Macos has no problem either. It's very strange.
Could be that the plugins you are using may not be having CMake files. You may compare it with the plugins with which it works. See https://github.com/flutter/flutter/issues/62059#issuecomment-662666870
Steps to reproduce
Now here's the question
I have downloaded and configured the flutter windows desktop environment, running flutter doctor is also normal, creating a new project after selecting the desktop will also work, but when I add any third party plugins in pubspec.yaml, running the following error, How should I solve this problem, or how to troubleshoot it
Actual results
Logs
Logs
```console ```Flutter Doctor output
Doctor output
```console ```