0

I'm using Ubuntu 18.04 with PHP 7.3.14. I was in my root directory and entered the command bin/magento setup:install and got this error. What is going on?

PHP Fatal error:  Uncaught Error: Cannot instantiate interface Project\Crawler\Api\CrawlerItemRepositoryInterface in /var/www/html/root/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:50
    Stack trace:
    #0 /var/www/html/root/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Project\\Crawler...')
    #1 /var/www/html/root/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(160): Magento\Framework\ObjectManager\ObjectManager->get('Project\\Crawler...')
    #2 /var/www/html/root/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(246): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Project\\Crawler...', NULL, 'crawlerItemRepo...', 'Project\\ImageCr...')
    #3 /var/www/html/root/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime('Project\\ImageCr...', Array, A in /var/www/html/root/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php on line 50

I have been looking at these but they didn't work for me:

3

Magento in attempting to instantiate the interface, interfaces cannot be instantiated. You need a class that implements the interface.

To do this use a preference in the di.xml that suggests which class to use for the CrawlerItemRepositoryInterface

1
  • Ow yea you are right. Nvm my answer Feb 10 '20 at 16:21
0

Well it does not find that interface or can not load it and that can have multiple reasons.

Here a couple :

  1. Your interface does not exist
  2. The interface has the wrong namespace
  3. The interface is in the wrong directory structure
  4. The interface wrong syntaxes
  5. The interface is opened with a <? tag instead of a <?php tag and your php settings does not allow shorthand php opening tags

EDIT

See Netstorm's answer. Will leave this here for debugging purposes for other people

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.