8

My magento store is throwing this error:

Fatal error: Cannot instantiate interface Magento\Framework\View\Design\Theme\ResolverInterface in /Library/WebServer/Documents/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php on line 73

I don't know why it started to appear. I made no new module installation. The store was working fine.

I've check file permissions and I see no issue there. Also delete the /var/ dir and, I think, all folders/files where created.

[EDIT] The preference is defined vendor/magento/magento2-base/app/etc/di.xml

<preference for="Magento\Framework\View\Design\Theme\ResolverInterface" type="Magento\Theme\Model\Theme\Resolver" /> 
  • 1
    i hope in ur custom module or code your trying to use Magento\Framework\View\Design\Theme\ResolverInterface in constructor or object manager – Pradeep Kumar Nov 24 '15 at 4:28
  • @PradeepKumar No. I'm not. – Filipe Sá Nov 24 '15 at 14:19
  • 2
    clear your cache and the contents of var/generation. – Marius Nov 24 '15 at 14:23
  • @Marius as stated in the question, I've already removed the /var/* folder completely. – Filipe Sá Nov 24 '15 at 14:28
  • Sorry. I missed that line. – Marius Nov 24 '15 at 14:44
16

If you use redis, run:


redis-cli flushall



If you also use an environment like ansible (lxc - server), you'll need to do that command in container. Plus I did the following:

  • Clear var/generation
  • Clear var/cache
  • Enable Magento modules: bin/magento module:enable --all
  • Compile DI bin/magento setup:di:compile
  • 1
    there were so many misleading solutions out there and this worked right away – Wolfe Jan 8 at 8:15
  • 2
    Enable Magento modules: bin/magento module:enable --all - Worked for me – Agnes Feb 18 at 12:40
5

I had this error and it was solved by clearing the var folder and then running setup:upgrade. If this doesn't solve it then look for errors in di.xml files

  • worked for me, specifically var/cache – Joshua Soileau Jul 25 '16 at 17:46
2

This worked for me :

 sudo apt-get install php-intl

 sudo service apache2 reload
1

In my case, I had to remove a module and I simply deleted the files of the module without following proper methods and then this error was on screen everywhere. After searching much I ended up to replace the files of the module back to same directory and deleted all required folders from var and ran the following commands.

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy

and all was fixed. I then followed proper ways to remove the module. Hope this saves someones time. :-)

1

Clear the cache rm -rf var/cache

If redis enabled, clear redis db using command line:

$> redis-cli
$> flushall
0

Run following command and check.

rm -rf generated

rm -rf var/*

Worked for me.

0
php bin/magento c:c
php bin/magento setup:di:compile

will fix your issue

0

Dump composer autoload files:

$ composer dumpautoload

Then:

bin/magento setup:upgrade
bin/magento setup:di:compile

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.