Skip to main content

Common Issues & Solutions

Quick solutions for the most frequently encountered problems in Remind Tools development.

Development Issues

Melos Bootstrap Failures

Error: Because X depends on Y version...Solution:
# Clear all caches
melos clean
flutter pub cache clean

# Remove lock files
find . -name "pubspec.lock" -delete

# Re-bootstrap
melos bootstrap --no-select
Error: Could not find package XSolution:
# Update pub cache
flutter pub cache repair

# If private package
cd packages/[package_name]
flutter pub get
cd ../..
melos bootstrap
Error: Version solving failedSolution:
# Use dependency override in pubspec.yaml
dependency_overrides:
  package_name: ^version

# Then bootstrap
melos bootstrap

Build Failures

Common iOS Issues

CocoaPods Issues
cd ios
pod cache clean --all
rm -rf Pods Podfile.lock
pod install --repo-update
Signing Issues
# Open in Xcode
open ios/Runner.xcworkspace
# Fix in: Signing & Capabilities
Build Clean
flutter clean
cd ios
xcodebuild clean
cd ..
flutter build ios

Runtime Issues

State Management

Always dispose of controllers and subscriptions to prevent memory leaks.
// BLoC disposal
@override
void dispose() {
  _bloc.close();
  super.dispose();
}

// Riverpod disposal
ref.onDispose(() {
  controller.dispose();
});

Performance Issues

ProblemSolution
Janky scrollingUse ListView.builder instead of ListView
Slow navigationPreload routes with precacheImage
Memory leaksCheck for disposed controllers
Large imagesUse cached_network_image package

API Issues

Supabase Connection

// Check connection
if (!supabase.auth.currentSession) {
  // Re-authenticate
  await supabase.auth.refreshSession();
}

// Handle errors
try {
  final data = await supabase.from('table').select();
} on PostgrestException catch (e) {
  print('Database error: ${e.message}');
} catch (e) {
  print('Network error: $e');
}

Rate Limiting

class RateLimitHandler {
  static Future<T> withRetry<T>(
    Future<T> Function() operation,
  ) async {
    int retries = 0;
    while (retries < 3) {
      try {
        return await operation();
      } on RateLimitException {
        await Future.delayed(
          Duration(seconds: math.pow(2, retries).toInt()),
        );
        retries++;
      }
    }
    throw Exception('Max retries exceeded');
  }
}

Testing Issues

Test Failures

# Update golden files
flutter test --update-goldens

# Platform-specific goldens
flutter test --update-goldens --platform=ios
testWidgets('test', (tester) async {
  // Increase timeout
  tester.binding.addTime(Duration(seconds: 30));
  
  // Or use longer timeout
}, timeout: Timeout(Duration(minutes: 2)));
# Run on specific device
flutter test integration_test/app_test.dart \
  -d "iPhone 14"

# With driver
flutter drive \
  --driver=test_driver/integration_test.dart \
  --target=integration_test/app_test.dart

Quick Fixes

Reset Everything

#!/bin/bash
# Complete reset script

echo "Cleaning Flutter..."
flutter clean

echo "Cleaning Melos..."
melos clean

echo "Clearing caches..."
flutter pub cache clean

echo "Removing lock files..."
find . -name "pubspec.lock" -delete
find . -name ".packages" -delete
find . -name ".dart_tool" -type d -exec rm -rf {} +

echo "Re-installing dependencies..."
melos bootstrap

echo "Running code generation..."
melos run generate

echo "Reset complete!"

Emergency Contacts