79661527

Date: 2025-06-11 07:07:48
Score: 2
Natty:
Report link

Yes, there’s a way to work around Codex-1’s lack of native Dart and Flutter support by writing a setup script that installs the necessary tools before running your commands. Here's a shell script that’s been shared by developers facing the same issue:

#!/bin/bash
set -ex
# Install Flutter SDK
FLUTTER_SDK_INSTALL_DIR="$HOME/flutter"
git clone https://github.com/flutter/flutter.git -b stable "$FLUTTER_SDK_INSTALL_DIR"
# Set up environment variables
export PATH="$FLUTTER_SDK_INSTALL_DIR/bin:$PATH"
echo "export PATH=\"$FLUTTER_SDK_INSTALL_DIR/bin:\$PATH\"" >> ~/.bashrc
# Precache Flutter binaries
flutter precache
# Navigate to your project directory
PROJECT_DIR="/workspace/[your_project_name]"
cd "$PROJECT_DIR"
# Get dependencies and run code generation
flutter pub get
flutter gen-l10n
flutter packages pub run build_runner build --delete-conflicting-outputs
# Run tests
flutter test

Replace [your_project_name] with your actual project folder. This script installs Flutter, updates the path, fetches dependencies, and runs tests — all in one go.

That said, some users have reported that Codex still struggles to execute test commands even after setup. If that’s the case, you might consider running tests outside Codex in a CI/CD pipeline or local dev environment and using Codex primarily for code generation and editing.

Reasons:
  • Long answer (-1):
  • Has code block (-0.5):
  • Me too answer (2.5): facing the same issue
  • Low reputation (1):
Posted by: Shahid Afridi