Problem with Administration Settings app

I wanted to create an App that is located in the Administration Settings.
I have followed these two Tutorials:

But none of them work!

After I enable the App and i want to reach the settings page, there is an internal Server Error.

Can somebody help please, or does somebody know any other tutorials that work?

This would be my code for the Admin Settings:

namespace OCA\NotesTutorial\Settings;

use OCP\AppFramework\Http\TemplateResponse;
use OCP\IConfig;
use OCP\IL10N;
use OCP\Settings\ISettings;

class NotesAdmin implements ISettings {

    /** @var IL10N */
    private $l;

    /** @var IURLGenerator */
    private $urlGenerator;

    /** @var IConfig */
    private $config;

    /** @var IL10N $l*/
    private $l;

    public function __construct(IConfig $config, IL10N $l) {
        $this->config = $config;
        $this->l = $l;

     * @return TemplateResponse
    public function getForm() {
  $parameters = array('key' => 'test');

        return new TemplateResponse('notestutorial', 'admin', $parameters, '');  

    public function getSection() {
        return 'notestutorial'; // Name of the previously created section.

     * @return int whether the form should be rather on the top or bottom of
     * the admin section. The forms are arranged in ascending order of the
     * priority values. It is required to return a value between 0 and 100.
     * E.g.: 70
    public function getPriority() {
        return 10;

This would be my code for the admin section:

namespace OCA\NotesTutorial\Sections;

use OCP\IL10N;
use OCP\IURLGenerator;
use OCP\Settings\IIconSection ;

class NotesAdmin implements IIconSection {

    /** @var IL10N */
    private $l;

    /** @var IURLGenerator */
    private $urlGenerator;

    public function __construct(IL10N $l, IURLGenerator $urlGenerator) {
        $this->l = $l;
        $this->urlGenerator = $urlGenerator;

    public function getIcon() {
        return $this->urlGenerator->imagePath('notestutorial', 'app.svg');

    public function getID() {
        return 'notestutorial';

    public function getName() {
        return 'Notes tutorial';

    public function getPriority() {
        return 98;

And this is my info.xml:

<?xml version="1.0"?>
<info xmlns:xsi= ""
    <name>Notes Tutorial</name>
    <author mail="testmail" >Julia</author>
        <nextcloud min-version="19" max-version="22"/>

And this is my admin.php file in the templates folder:

script('notestutorial', 'admin');
style('notestutorial', 'admin');

<div id="admin">

do you have a repository ?

No I am sorry, but the code is like the appskeleton
plus the changes I’ve already posted.


I added a missing line in Settings\NotesAdmin.php

use OCP\IURLGenerator;

Note that your have 2 definitions of private $l; in this file.

I added an app.svg in app_root/img/

and voila:


If after the fix it is still not working, might comes from the location of your files.

1 Like

Now it works, thank you very much. :grinning: