Help getting a context menu addon working
#1
Hi, I'm trying to create a custom context item add-on, following the instructions on the Wiki (Context_Item_Add-ons (wiki)). I'm running Kodi Matrix (v19), the latest stable release. I downloaded the Hello World Add-on (HOW-TO:HelloWorld_addon (wiki)) and, after changing the python dependency to Python 3 installed it without issue. I'm trying to convert it into a context item add-on, but I'm not having any luck. Here is my addon.xml:
xml:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.hello.world" name="Hello World" version="1.0.2" provider-name="zag">
    <requires>
        <import addon="xbmc.python" version="2.14.0"/>
    </requires>
    <extension point="xbmc.python.script" library="addon.py">
        <provides>executable</provides>
    </extension>
    <extension point="kodi.context.item">
        <menu id="kodi.core.main">
            <item library="contextitem.py">
                <label>TEST</label>
                <visible>true</visible>
            </item>
        </menu>
    </extension>
    <extension point="xbmc.addon.metadata">
        <platform>all</platform>
        <summary lang="en">Popup Hello World</summary>
        <description lang="en">Example Script to show Hello World</description>
        <license>GNU General Public License, v2</license>
        <language></language>
        <forum>http://forum.kodi.tv/showthread.php?tid=209948</forum>
        <source>https://github.com/zag2me/script.hello.world</source>
        <website>Kodi.tv</website>
        <email>zag@kodi.org</email>
        <assets>
            <icon>icon.png</icon>
            <fanart>fanart.jpg</fanart>
            <screenshot>resources/screenshot-01.jpg</screenshot>
            <screenshot>resources/screenshot-02.jpg</screenshot>
            <screenshot>resources/screenshot-03.jpg</screenshot>
        </assets>
        <news>Updated the addon to use new addon.xml metadata</news>
    </extension>
</addon>

To be clear, the only change I made from the working add-on is adding the extension point for the kodi context item:
xml:

    <extension point="kodi.context.item">
        <menu id="kodi.core.main">
            <item library="contextitem.py">
                <label>TEST</label>
                <visible>true</visible>
            </item>
        </menu>
    </extension>

The only relevant excerpt from the Kodi logs:
Code:
DEBUG<general>: CAddonInstaller: installing from zip '/home/admin/Documents/addons/script.hello.world-master.zip'
ERROR<general>: CAddonInfoBuilder::Generate: Unable to load 'zip://%2fhome%2fadmin%2fDocuments%2faddons%2fscript.hello.world-master.zip/script.hello.world-master/addon.xml', Line 29
Error reading end tag
Reply
#2
Whoops, sorry, I'm posting on a different device. I forgot to edit the Python version above. It has been changed in the file itself:
xml:

    <requires>
        <import addon="xbmc.python" version="3.0.0"/>
    </requires>
Reply
#3
Thread moved to addon development, as the add-on support section is for published/established add-ons.
|Banned add-ons (wiki)|Forum rules (wiki)|VPN policy (wiki)|First time user (wiki)|FAQs (wiki) Troubleshooting (wiki)|Add-ons (wiki)|Free content (wiki)|Debug Log (wiki)|

Kodi Blog Posts
Reply
#4
(2022-12-08, 09:42)iqbd Wrote: To be clear, the only change I made from the working add-on is adding the extension point for the kodi context item:
<extension point="kodi.context.item"> <menu id="kodi.core.main"> <item library="contextitem.py"> <label>TEST</label> <visible>true</visible> </item> </menu> </extension>

I believe Label need to be a valid variable or a string.  TEST is not a valid variable nor string.  Try "TEST" or a valid number from strngs.po.

<label>"TEST"</label>

Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply

Logout Mark Read Team Forum Stats Members Help
Help getting a context menu addon working0