# Source set 'main' not found in project ':app'. Please make sure the java plugin is applied.

- **ID:** `java/gradle-missing-source-set`
- **Domain:** java
- **Category:** build_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The Java plugin is not applied to the project, so the default source sets 'main' and 'test' are not available.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 7+ | active | — | — |

## Workarounds

1. **Apply the Java plugin to the project** (95% success)
   ```
   plugins { id 'java' }
   ```
2. **Apply the 'java-library' plugin if the project is a library** (95% success)
   ```
   plugins { id 'java-library' }
   ```

## Dead Ends

- **Manually defining the source set without the Java plugin** — The Java plugin provides necessary tasks and configurations; manual definition may lead to missing tasks. (80% fail)
- **Using the 'java-library' plugin instead of 'java'** — The 'java-library' plugin extends 'java', so it also works, but the error may persist if not applied. (50% fail)
