Kodi Community Forum

Full Version: xbmc json import error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I have one android box which has "OS = Android 4.4.2 API level 19 (kernel: Linux 3.0.36+)". I am trying to execute xbmc json in program addon to access XBMC feature from program addon. Like skin settings addon enable etc.
But at the time of importing XBMC json it gives and error. As its running nice in windows and Linux machine.

This line gives an error as below : from xbmcjson import XBMC

Quote:05:17:09 T:1866865248 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.SyntaxError'>
Error Contents: ('invalid syntax', ('<string>', 4, 2, ' '))
Traceback (most recent call last):
File "/mnt/internal_sd/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.program.test/default.py", line 5, in <module>
from xbmcjson import XBMC
File "/mnt/internal_sd/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.program.test/xbmcjson.py", line 106, in <module>
exec (s)
SyntaxError: ('invalid syntax', ('<string>', 4, 2, ' '))
-->End of Python script error report<--
I don't know why it is not working on your device, but you can also use JSON-RPC without xbmcjson.py module. You can made JSON-RPC call as shown in following example.

If you want to enable any specific add-on (for example plugin.video.kodiaddon) using JSON-RPC, you just need to open following url.

http://127.0.0.1:8080/jsonrpc?request={"jsonrpc":"2.0","id":"1","method":"Addons.SetAddonEnabled","params":{"addonid":"'plugin.video.kodiaddon'","enabled":true}}

For more information follow link given below
http://www.kodi-development.com/kodi-ski...g-jsonrpc/