John Pancoast's answer is correct.
Just to add something else in case others reach this. I had an issue causing the same error but it was due to my entities living in a codebase that used PSR-4. Doctrine does not support PSR-4 when doing anything with code generation. It has to do with how they map class namespaces to filesystem paths and how PSR-4 allows class/namespace paths that don't directly map to the filesystem.
https://github.com/doctrine/DoctrineBundle/issues/282
To clarify exactly what is needed to resolve the error message; edit your bundle's composer.json
file, and also change the bundle's folder structure.
in composer.json
change psr-4
to psr-0
:
"autoload": {
"psr-4": { "Acme\\Bundle\\AwesomeBundle\\": "" }
},
to:
"autoload": {
"psr-0": { "Acme\\Bundle\\AwesomeBundle\\": "" }
},
Change bundle's folder structure from:
vendor
+--acme
+--awsome-bundle
|--Controller
|--Entity
to:
vendor
+--acme
+--awsome-bundle
+--Acme
+--Bundle
+--AwsomeBundle
|--Controller
|--Entity
The following command wil no longer throw an exception:
bin/console doctrine:generate:entities AwesomeBundle