Open woteska opened 2 months ago
We are getting this exact same issue as well.
Seems like tempDir might be invalid?
/// Run "pub get" in the client project.
Future<void> runPubGet(Directory tempDir) async {
final command = isUsingFlutter ? 'flutter' : 'dart';
final result = await runProcess(
command,
const ['pub', 'get'],
stdoutEncoding: utf8,
stderrEncoding: utf8,
workingDirectory: tempDir.path,
runInShell: platformIsWindows,
);
if (result.exitCode != 0) {
throw Exception(
'Failed to run "pub get" in the client project:\n'
'${result.stdout}\n'
'${result.stderr}',
);
}
}
flutter pub get works when run in command line.
This is the tempDir it is trying to use that does not exist: '/var/folders/dm/xz10cgy114g5plf8c02h19mr0000gq/T/custom_lint_clientn65kUQ'
@rrousselGit I pulled down the latest from git and pointed my project at it. FWIW the analyzer plugin started working when I specified the full path to my flutter command:
final command = isUsingFlutter ? '/Users/Eric.Schlichting/Library/Flutter/bin/flutter' : 'dart';
Seems like something change with the resolution of that command. Maybe the path isn't setup properly in the process anymore.
@rrousselGit I pulled down the latest from git and pointed my project at it. FWIW the analyzer plugin started working when I specified the full path to my flutter command:
final command = isUsingFlutter ? '/Users/Eric.Schlichting/Library/Flutter/bin/flutter' : 'dart';
Seems like something change with the resolution of that command. Maybe the path isn't setup properly in the process anymore.
If I downgrade and pin to 0.6.5 or 0.6.6 it works again. Can you test it? custom_lint: 0.6.6
@woteska that works for us as well. Thank you!
Downgrading worked for me too. I'm using fvm
to manage flutter versions - I wonder if its related.
I'm experiencing this issue on Android Studio + macOS environment. Here's something I found out.
macOS sets the PATH environment value to /usr/bin:/bin:/usr/sbin:/sbin
for new processes launched by Finder or Launchpad and so on. Android Studio launched through JetBrains Toolbox seems to have the same value. And the Dart Analysis Server launched by Android Studio is also the same and it can be checked by accessing the diagnostics web page. As far as I know, according to the installation guide of Flutter, in most cases the flutter
binary is not in /usr/bin
but somewhere in the home directory like ~/flutter/bin
. So custom_lint is unable to find flutter
.
As a workaround I tried to symlink e.g. sudo ln -s ~/flutter/bin/flutter /usr/bin/flutter
but failed because of System Integrity Protection. So I think macOS users are unable to use custom_lint for now.
I think there are two approaches to solve this problem.
flutter
or dart
binary path configurable.runInShell: true
to read the shell profile and set the PATH variable properly.
Process.run
executes /bin/sh
, macOS users who only use .zprofile
wouldn't be able to solve the problem with this approach.Or maybe the Dart Analysis Server could be changed to pass the dart
binary path to plugins.
Describe the bug
The lint errors do not appear at all in my Android Studio Dart Analysis tab nor in the source code highlighted, and custom_lint.log contains the following error (it does not make any sense to me - flutter pub get exceeds sucessfully):
If I run
dart run custom_lint
, I see the lint issues in the console output (as expected).To Reproduce
IDE:
IDE plugins: Dart Plugin: 241.1880 Flutter Plugin: 81.0.2
Full pubspec.lock (uploaded with .log extension as github does not allow to upload files ending with .lock): pubspec.lock.log
Flutter doctor
I attach the Android Studio Analysis Server Diagnostics report as well: dart_analyzer_diagnostics_report.json
analysis_options.yaml:
Resolve attemptions
I tried to upgraded-downgraded the Flutter SDK, analyzer. I also tried to run flutter clean, flutter pub cache clean. But wasn't able to make it work, only if I downgrade custom_lint to 0.6.6 or 0.6.5.
Expected behavior
I should see the lint errors in Dart Analysis tab in Android Studio, and I also should see the errors in the source code highlighted.
Additional notes
It perfectly works with Visual Studio Code IDE as expected.
I am not sure the issue can regards to macros, but they are disabled in my IDE because of a previous issue: