Error: The service 'xxx' has a dependency on a non-existent service

Hi,

I follow this tutorial Shopware Online Academy and I have the following error when I relaod the page:

# The service "SwagShopFinder\Core\Api\DemoDataController" has a dependency on a non-existent service "swag_shop_finder.repository". Did you mean this: "swag_shop_finder .repository"?

Any ideea what could be?

later edit:
the services.xml file content is the following:

<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <services>
        <service id="SwagShopFinder\Core\Content\ShopFinder\ShopFinderDefinition">
            <tag name="shopware.entity.definition" entity="swag_shop_finder" />
        </service>

        <service id="SwagShopFinder\Core\Api\DemoDataController" public="true">
    !!        <argument id="country.repository" type="service" />
    !!        <argument id="swag_shop_finder.repository" type="service" />
            <call method="setContainer">
                <argument type="service" id="service_container" />
            </call>
        </service>

        <service id="SwagShopFinder\Storefront\Subscriber\FooterSubscriber">
            <argument id="Shopware\Core\System\SystemConfig\SystemConfigService" type="service" />
     !!       <argument id="swag_shop_finder.repository" type="service" />
            <tag name="kernel.event_subscriber" />
        </service>
    </services>
</container>

Here I have 3 errors: 'Cannot resolve symbol ‚country.repository‘ and ‚swag_shop_finde_repository‘ the lines on the lines that begin with !!

Thanks!

Check the namespace and the autoloader in the composer.json.

I don’t know the online academy, but shopware usually recommends a namespace starting with the manufacturer code, e.g. Swag\ShopFinder\Core\Api\DemoDataController.

This the error message really what is says, so :

Did you mean this: „swag_shop_finder .repository“

So with the space before the dot ???

Then I would assume you have an extra space in the file SwagShopFinderDefinition and check the string for ENTITY_NAME. Maybe there is an extra space also, which is legal but hard to read.

This line seems to be ok, maybe related to the other error

country.repository

best

cha