2022-11-04, 20:09
Hi guys, my first post here: I'm facing a strange problem while developing my first video addon for Kodi v19 Matrix. I'm testing my code in two different environments:
Addon.xml code
main.py
ui.py
This is the kodi.old.log and this is the kodi_crash.log
Sorry if I've some dumb/noob mistake, but I've read a lot of examples and it seems all correct to me. Thanks you all for the support in advance!
- A fresh install of Kodi v19.4 Matrix on a Windows 10 x64 desktop with Python 3.10.6 (these are the first lines of kodi.log when Kodi starts):
txt:2022-11-04 17:33:41.561 T:20052 INFO <general>: Starting Kodi (19.4 (19.4.0) Git:20220302-e12e66e019). Platform: Windows NT x86 64-bit
2022-11-04 17:33:41.561 T:20052 INFO <general>: Using Release Kodi x64
2022-11-04 17:33:41.561 T:20052 INFO <general>: Kodi compiled 2022-03-03 by MSVC 191627045 for Windows NT x86 64-bit version 10.0 (0x0A000007)
2022-11-04 17:33:41.561 T:20052 INFO <general>: Running on Windows 10 22H2, kernel: Windows NT x86 64-bit version 10.0.19045.2130
2022-11-04 17:33:41.561 T:20052 INFO <general>: FFmpeg version/source: 4.3.2-Kodi - LibreELEC 10.0.3 on a Raspberry Pi 3 (starting of kodi.log here):
txt:2022-11-04 17:36:35.633 T:14663 INFO <general>: Starting Kodi (19.4 (19.4.0) Git:286694e9df8741313a688b46940661a30f36f35c). Platform: Linux ARM 32-bit
2022-11-04 17:36:35.633 T:14663 INFO <general>: Using Release Kodi x32
2022-11-04 17:36:35.633 T:14663 INFO <general>: Kodi compiled 2022-10-15 by GCC 10.2.0 for Linux ARM 32-bit version 5.10.110 (330350)
2022-11-04 17:36:35.633 T:14663 INFO <general>: Running on BCM2835 with LibreELEC (official): 10.0.3, kernel: Linux ARM 32-bit version 5.10.110
2022-11-04 17:36:35.634 T:14663 INFO <general>: FFmpeg version/source: 4.3.2-Kodi
txt:
\root
\resources
\lib
ui.py
\skins
\Default
\1080i
search_page.xml
addon.xml
icon.png
main.py
Addon.xml code
xml:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.elendar.crash_test" name="Crash Test for LibreELEC 10.0.3" version="1.0.0" provider-name="Galaron">
<requires>
<import addon="xbmc.python" version="3.0.0"/>
<import addon="script.module.beautifulsoup4"/>
<import addon="script.module.requests"/>
</requires>
<extension point="xbmc.python.pluginsource" library="main.py">
<provides>video</provides>
</extension>
<extension point="xbmc.addon.metadata">
<language>en</language>
<platform>all</platform>
<assets>
<icon>icon.png</icon>
</assets>
</extension>
</addon>
main.py
python:
import xbmcaddon
from resources.lib.ui import SearchPage
from resources.lib.utils import KodiUtils
# Get addon instance
_ADDON: xbmcaddon.Addon = xbmcaddon.Addon()
# Get addon full path
_ADDON_PATH: str = _ADDON.getAddonInfo('path')
if __name__ == '__main__':
KodiUtils.log("Showing search page")
search_page: SearchPage = SearchPage('search_page.xml', _ADDON_PATH, defaultRes='1080i')
search_page.doModal()
del search_page
KodiUtils.log("Search page closed") # I can see this message in logs, so controls returns here when dialog closes, but then Kodi crash
ui.py
python:
import xbmcgui
from xbmcgui import Action
from resources.lib.utils import KodiUtils
class SearchPage(xbmcgui.WindowXMLDialog):
__SEARCH_BAR_ID: int = 9001
# IF I COMMENT THESE TWO LINES, CODE WORKS ALSO ON RPi 3
def onInit(self) -> None:
self._search_bar = self.getControl(SearchPage.__SEARCH_BAR_ID)
def onAction(self, action: Action) -> None:
KodiUtils.log("User has requested action with ID {}".format(action.getId()))
if action.getId() in [xbmcgui.ACTION_BACKSPACE, xbmcgui.ACTION_NAV_BACK, xbmcgui.ACTION_PREVIOUS_MENU]:
KodiUtils.log("Closing by calling self.close()")
self.close()
else:
super().onAction(action)
This is the kodi.old.log and this is the kodi_crash.log
Sorry if I've some dumb/noob mistake, but I've read a lot of examples and it seems all correct to me. Thanks you all for the support in advance!