I try to install sonata admin user bundle in symfony 4 project:
composer create-project symfony/website-skeleton my-project
composer require sonata-project/admin
One of the differences between S3 and S4 is that the framework itself no longer has any template engines by default. The usual twig stuff still works as long as you have installed the website-skeleton or manually installed twig. But still no templating service.
You need to:
composer require templating
And then set the templating engine in your framework config:
# config/packages/framework.yaml
templating:
engine: 'twig'
After that you can verify that you have a templating service with bin/console debug:container
And though I don't use the sonata admin bundle myself, it seems to install cleanly at least.
Bit of a mystery as to why the template recipe is not installed as part of the website-skeleton. But oh well.
There is already an issue reported on their github, you can find the solution to your problem here :
https://github.com/sonata-project/SonataAdminBundle/issues/4910#issuecomment-360587312