Solved Add-on works on Windows but not Android
#1
I'm working on an add-on and it doesn't run on Python 3 because the whole Unicode and byte strings issue but it also fails on Android. It works fine on Windows but when I try to run it on Android Kodi 15.2-RC2 it throws an exception.

Code:
Error Type: <type 'exceptions.SyntaxError'>
                                            Error Contents: ('invalid syntax', ('<string>', 2, 1, '\r\n'))

Can anyone point me in the right direction to solve this?

Thanks
Reply
#2
"There are no psychics" © The Mentalist. Please provide more info like your code examples and a full exception traceback from a Kodi log if you want to get real help.

But what I can tell now is that on different platforms Kodi uses different Python versions 2.6-2.7. In particular, Kodi for Android uses Python 2.6. so writing your addons you should go by the syntax and the standard library contents of Python 2.6.
Reply
#3
I think it might have something to do with the EOL conversion. Every time I save the file and set it to UNIX and I re-open it it is still detected as DOS/Windows format.
Reply
#4
So basically I am manually encoding and decoding a string. If I do

Code:
"\n".join(mybase64encodedstring.splitlines())

then the script runs fine. I guess the problem is with the program I am using to decode and encode.
Reply
#5
Yes the problem was with program i was using for decoding and encoding. I wrote a small script to do it programmatically and everything is working fine now.
Reply

Logout Mark Read Team Forum Stats Members Help
Add-on works on Windows but not Android0