Search code examples
dartcontinuous-integrationcodemagic

"dart: Command not found" when running Dart commands in Codemagic


when I try to run Dart commands (even simple dart --version) in Codemagic it fails with an error saying dart: command not found.


Solution

  • to overcome the issue you need to update your scripts to run $FLUTTER_ROOT/bin/dart instead.

    There is no separate Dart SDK on Codemagic build machines, only Flutter SDK and you can use the Dart version shipped with Flutter.

    For instance

    #!/bin/sh
    
    $FLUTTER_ROOT/bin/dart --version