Add-on Development Workflow?
#1
I'm trying to get started with making my own Kodi add-ons, and I'm falling on my face.

I can download and install the Hello World script, but when I try to make any changes to it, I get a "Failed to install add-on from zip file" error. What gives?

What development process do you all follow? How do you install and test your addons? Do you copy over your add-on to the userdata folder? Do you install it through the interface? Do you test it manually, or do you write tests?

Here are my notes: http://radavis.github.io/2016/07/16/buil...d-ons.html
Here's my fork of the Hello World repo: https://github.com/radavis/script.hello.world
Reply
#2
the Debug Log might provide you with some info on why installation from zip fails.

since (i think) you're using osx, check if it doesn't add any hidden files/folders to the zip (.DS_Store and the likes),
that might be causing issues.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#3
Thanks for the debug log tip, ronie. I updated that wiki page, since the menu names have changed.

I've been able to narrow down my exact issue when developing:

1. Package up addon: `zip -r script.hello.world.zip script.hello.world/*`
2. Kodi > System > Add-ons > Install from zip file
3. Kodi > Programs > Script Name
4. Make some changes
5. Repeat steps 1 and 2. "Failed to install Add-on from zip file."

Here's the log from after step 5.

Code:
11:56:36 T:140735157313536   DEBUG: ------ Window Deinit (FileBrowser.xml) ------
    11:56:36 T:140735157313536   DEBUG: CAddonInstaller: installing from zip '/Users/rd/code/script.hello.world.zip'
    11:56:36 T:123145303990272   ERROR: CAddonInstallJob[script.hello.world]: could not read addon description of special://home/addons/script.hello.world
    11:56:36 T:140735157313536   DEBUG: CGUIMediaWindow::GetDirectory ()
    11:56:36 T:140735157313536   DEBUG:   ParentPath = []
    11:56:36 T:123145304526848   DEBUG: Thread BackgroundLoader start, auto delete: false
    11:56:36 T:140735157313536   DEBUG: ------ Window Init (DialogKaiToast.xml) ------
    11:56:36 T:123145304526848   DEBUG: Thread BackgroundLoader 123145304526848 terminating

I figured out that if I restart Kodi, I can install my changes successfully. So, my development workflow ends up looking something like this:

1. Package up addon: `zip -r script.hello.world.zip script.hello.world/*`
2. Kodi > System > Add-ons > Install from zip file
3. Kodi > Programs > Script Name
4. Make some changes
5. Restart Kodi
6. Go to step 1

It feels kinda clunky, but I suppose I can live with it.

Does anyone practice a more efficient workflow when developing add-ons? If so, I'd love to hear about it.
Reply
#4
there's no need to zip and re-install your addon each time after you've made a change.

just create a symlink in the kodi addons folder to the folder that contains the sourcecode of your addon.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#5
Yes! This is exactly the advice I needed...

Code:
$ ln -s /Users/rd/code/script.hello.world  ~/Library/Application\ Support/Kodi/addons/script.hello.world

Now, I can make modifications to my script, and see the changes immediately in Kodi. Thanks a million!
Reply

Logout Mark Read Team Forum Stats Members Help
Add-on Development Workflow?0