0
votes
php bin/console clear-cache:

PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "Use rBundle" from namespace "UserBundle\UserBundle". Did you forget a "use" statement for another namespace? in /var/www/html/projects/Event-Finance/api/app/AppKernel.php:21 Stack trace:#0 /var/www/html/projects/Event-Finance/api/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(48 8): AppKernel->registerBundles()#1 /var/www/html/projects/Event-Finance/api/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(13 2): Symfony\Component\HttpKernel\Kernel->initializeBundles() #2 /var/www/html/projects/Event-Finance/api/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/App lication.php(64): Symfony\Component\HttpKernel\Kernel->boot() #3 /var/www/html/projects/Event-Finance/api/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php( 148): Symfony\Bundle\FrameworkBundle\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Componen in /var/www/html/projects/Event-Finance/api/app/AppKernel.php on line 21

2

2 Answers

1
votes

I have passed 2 days to fix this error by uploading, configuring symfony several time. Changing the directory permissions and so many thing. Finally I have fix this issues in my Symfony 3.4 project.

There are 2 things you need to do to fix this error:

  1. In the composer.json, modify the psr-4 section under autoload section like this.
"autoload": {
    "psr-4": {
        "": "src/"
    },
},
  1. Then execute the following command

composer dumpautoload

0
votes

There is a typo in your bundle name:

Use rBundle should be UserBundle.