-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
Cannot run program "dartanalyzer": CreateProcess error=2, The system cannot find the file specified #24
Comments
same issue here i'm using windows 7 |
I have the same issue, i tried with either dark-sdk installed by flutter and installing dart-sdk manually, both times having dart-sdk in my PATH, still the same issue. Of course, when i use manually any dartanalyzer commands like "dartanalyzer lib test" it works, so i dont know why it doesn't work, probably it's from the binary plugin ? Any updates on this issue please ? |
Any update for this issue? Same issue. |
Same issue, windows server 2012 |
I have the same issue in windows 10 |
I think it's something related to windows...Maybe add the .bat at the end of the command |
@victorgilc Yes it's true, the plugin tries to run 'dartanalyzer -h' but can't because it needs to call 'dartanalyze.bat -h'. |
Exactly, I did the patch locally, I'll try to create a pull request as soon I'm able to test it. DartAnalyzerSensor.java: private static final String ANALYZER_COMMAND = System.getProperty("os.name").toUpperCase().contains("WINDOWS")?"dartanalyzer.bat":"dartanalyzer"; |
@victorgilc your answer works for me but I have new issue, Any idea? |
Yeah, a lot of errors actually...I'll work on the fix. I'll let you know when it's finished. Please let me know if you finish it first lol. Now I'm facing something related to "tests.output" |
Yes, @victorgilc, it is true, I solved it by changing the code of the code in the FlutterTestReportParser.java class with the help of PR #22. Am I a little uncomfortable there are several open pull requests, the approvers disappeared? |
Maybe these guys didn't have time enough to approve in the last few days...At least it's open-source. |
Same issue here ! |
I'm working on it. I'll try to finish it at the weekend. If someone wants to help me, I appreciate it. |
Well, I'm not finished yet, but there's something wrong with the following regex inside the class "DartAnalyzerReportParser.java": Pattern pattern = Pattern.compile("(.)•(.)•(.):(.):(.)•(.)"); With the "dartanalyzer" output, this regex isn't able to create any sonar issue. |
I opened a PR. please reach me for any concerns. |
The pull request that fixes this bug was merged to the development branch today. |
Issue is fixed in release 0.3.0 (it includes @victorgilc PR). |
Hello guys, I hope you are doing well, I am using the release 0.3.1, during the scanner I found the related problem here in the previous posts. ERROR: Could not startup process 'dartanalyzer -h'. Should we reopen the issue? Thank you in advance! |
Hi @epadilhaf3, Is Flutter properly installed on your runner ? For example, here is what I use to run an analysis on Gitlab :
|
Hey @zippy1978, thank you for your response, I hope you are doing well. stages:
- test
- sonar_analysis
unit_test:
stage: test
image: cirrusci/flutter:stable
script:
- pub get
- dartanalyzer lib test
- pub run test --reporter expanded
- pub run test_coverage
- genhtml coverage/lcov.info -o coverage
artifacts:
paths:
- coverage/
.sonar_template: &sonar_common
stage: sonar_analysis
image: sonarsource/sonar-scanner-cli
variables:
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar"
cache:
key: ${CI_JOB_NAME}
paths:
- .sonar/cache
sonar_push:
<<: *sonar_common
script:
- sonar-scanner -Dsonar.projectKey=$CI_PROJECT_NAME -Dsonar.qualitygate.wait=true -Dsonar.branch.name=$CI_COMMIT_BRANCH
sonar_mr:
<<: *sonar_common
script:
- sonar-scanner -Dsonar.projectKey=$CI_PROJECT_NAME -Dsonar.pullrequest.key=$CI_MERGE_REQUEST_IID -Dsonar.pullrequest.branch=$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME -Dsonar.pullrequest.base=master
rules:
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"' The complete log is the following:
Thank you again. |
Hi @epadilhaf3, The problem is that when you move to stage "sonar_analysis", you switch to image "sonarsource/sonar-scanner-cli", where flutter is not installed. |
Hey, thanks, I'll change it, and test. |
any update on this? |
I don't think there is anything to do here. If you experience this message you need to make sure that you ran |
Hi,
I'm facing a big problem.
my sonar-scanner.properties file:
sonar.host.url=//my server sonarqube
sonar.login=//my code to login
sonar.projectKey=//my projectKey
sonar.projectName=//my projectName
sonar.projectVersion=1.0.0
sonar.exclusions=.scannerwork/, .git/, vendor/, logs/, android/, ios/
sonar.projectBaseDir=Source
sonar.sources=lib
sonar.tests=test
sonar.sourceEncoding=UTF-8
When i run sonarqube: sonar-scanner -Dproject.settings=sonar-scanner.properties
i got errors:
INFO: Scanner configuration file: D:\Devops\Sonar-Scan\sonar-scanner-3.3.0.1492-windows\bin..\conf\sonar-scanner.properties
INFO: Project root configuration file: D:\JenkinsAgentIT2\workspace\MyProject\sonar-scanner.properties
INFO: SonarQube Scanner 3.3.0.1492
INFO: Java 1.8.0_121 Oracle Corporation (64-bit)
INFO: Windows NT (unknown) 10.0 amd64
INFO: User cache: C:\Users\Administrator.sonar\cache
INFO: SonarQube server 7.4.0
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Publish mode
INFO: Load global settings
INFO: Load global settings (done) | time=79ms
INFO: Server id: XXXXXXXXXXXXXX
INFO: User cache: C:\Users\Administrator.sonar\cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=48ms
INFO: Load/download plugins (done) | time=79ms
INFO: Loaded core extensions:
INFO: Process project properties
INFO: Execute project builders
INFO: Execute project builders (done) | time=5ms
INFO: Load project repositories
INFO: Load project repositories (done) | time=57ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=32ms
INFO: Load active rules
INFO: Load active rules (done) | time=2158ms
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=25ms
INFO: Project key: my projectKey
INFO: Project base dir: D:\JenkinsAgentIT2\workspace\MyProject\Source
INFO: ------------- Scan MyProject
INFO: Base dir: D:\JenkinsAgentIT2\workspace\MyProject\Source
INFO: Working dir: D:\JenkinsAgentIT2\workspace\MyProject\Source.scannerwork
INFO: Source paths: lib
INFO: Test paths: test
INFO: Source encoding: UTF-8, default locale: en_US
INFO: Load server rules
INFO: Load server rules (done) | time=208ms
INFO: Index files
INFO: 253 files indexed
INFO: Quality profile for dart: dartanalyzer
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=5ms
INFO: Sensor Dart sensor [flutter]
INFO: Sensor Dart sensor [flutter] (done) | time=5864ms
INFO: Sensor dartanalyzer sensor [flutter]
INFO: Backup of original analysis_options.yaml file to analysis_options.yaml.sonar
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 12.142s
INFO: Final Memory: 291M/1042M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
ERROR: Could not startup process 'dartanalyzer -h'.
ERROR: Caused by: Cannot run program "dartanalyzer": CreateProcess error=2, The system cannot find the file specified
ERROR: Caused by: CreateProcess error=2, The system cannot find the file specified
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
I checked dartanalyzer -h in the same folder, it fines!
Usage: dartanalyzer [options...]
-h, --help Display this help message. Add --verbose to show hidden options.
-v, --verbose Verbose output.
--default-language-version The default language version when it is not specified via other ways (internal, tests only).
Run "dartanalyzer -h -v" for verbose help output, including less commonly used options.
For more information, see https://www.dartlang.org/tools/analyzer.
Anyone can suggest me the solution, please :(
The text was updated successfully, but these errors were encountered: