Magento 2 Admin Error: Exception #0 (ReflectionException): Class Authorization Model Acl GroupFactory does not exist

Problem:

  • Opened Magento 2 Admin
  • Entered the correct admin login information
  • And then, got the following error:

Exception #0 (ReflectionException): Class Magento\Authorization\Model\Acl\Role\GroupFactory does not exist

Cause:

It’s related to the factory classes that Magento generates inside var/generation directory.

Solution:

Clearing var/generation directory solved the error.

  • Open terminal/command-prompt
  • Go to your Magento root directory
  • Run the following command:

rm -rf var/generation/*

Now, you should be able to login to your Magento admin without any error.

Hope this helps. Thanks.