Could not start flutter analyse

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
  • what are you trying to achieve
  • what have you tried so far to achieve this

Hi, I’m new here.
Our team is using SonarQube 9.3.0, running on a Ubuntu 20.04 AWS machine and I’ve added the plugin sonar-flutter-plugin-0.4.0.jar to the plugins folder. We have a mobile flutter project.

I’m trying to use it with GitHub, but on every PR, it was showing no code problems. I then checked the terminal on GitHub and saw this:

INFO: Running 'flutter analyze'...

ERROR: org.buildobjects.process.StartupException: Could not startup process 'flutter analyze'. org.buildobjects.process.StartupException: Could not startup process 'flutter analyze'.

And a few lines below I’ve got this:

Caused by: Cannot run program "flutter": error=2, No such file or directory

So I think SonarQube is not finding my flutter. But when I run the following, as you can see, I have flutter and dart installed and on my path.

xxxx@ip-xxx-xx-xx-xx:~$ which flutter
xxxx@ip-xxx-xx-xx-xx:~$ which dart

Here is my config files:


name: Build
    branches: [master, develop] # or the name of your main branch
    types: [opened, synchronize, reopened]
    name: Build
    runs-on: ubuntu-latest
      - uses: actions/checkout@v2
          fetch-depth: 0
      - uses: sonarsource/sonarqube-scan-action@master
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
          SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
      # If you wish to fail your job when the Quality Gate is red, uncomment the
      # following lines. This would typically be used to fail a deployment.
      # We do not recommend to use this in a pull request. Prefer using pull request
      # decoration instead.
      # - uses: sonarsource/sonarqube-quality-gate-action@master
      #   timeout-minutes: 5
      #   env:
      #     SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

# Project identification

# Source code location.
# Path is relative to the file. Defaults to .
# Use commas to specify more than one folder.
# sonar.tests=test

# Encoding of the source code. Default is default system encoding.

# Allows reuse of an existing analyzer report
# sonar.dart.analysis.reportPath=

# Analyzer mode
# Can be:
# - flutter (flutter analyze) - default
# - dart (dart analyze)
# - legacy (dartanalyzer)
# sonar.flutter.analyzer.mode= 

I don’t know what to try anymore. :frowning_face:
Could someone help me??

Hey there.

Your best bet is to raise an issue on the open-source repository of this community-supported plugin. GitHub - insideapp-oss/sonar-flutter: SonarQube plugin for Flutter / Dart

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.