I’m not going to tell you how long I’ve spent figuring out why LiveCode wouldn’t compile to Android, throwing “could not compile service support class” errors. Apparently this is one of the more common errors when compiling to Android, but typically this indicates a problem with the “mobile setup” (Android Studio, Java).
This was different. I had LiveCode (9.0.3) setup on a Windows machine, Android Studio installed and properly setup. The “mobile” preferences looked OK (path to Android SDK and Java were present and correct), and most crucially, using this setup I had compiled stacks successfully. Now I had a very simple stack and suddenly I got this error. Shockingly, the stack that had compiled an hour earlier wouldn’t compile any more. I tried many things, and sometimes the stack that was ‘good’ before would still compile, but sometimes it wouldn’t.
It turns out that although LiveCode generally is not case sensitive, it actually can be. I had this one line in my code (this code actually doesn’t work on Android, but I wanted to test whether it works):
set the defaultFolder to specialFolderPath("Documents")
it should have been:
set the defaultFolder to specialFolderPath("documents")
Yes, really, that was all. So in this instance, LiveCode was case sensitive, and quite atypically it didn’t detect the error during coding (LiveCode’s errors when compiling for mobile can be quite cryptic/useless).
Now, I also found that once I got this error, LiveCode would fail to compile anything (yes, even an empty stack) — until I restart the program. So I learned two things here: first, LiveCode can be case sensitive, second, when LiveCode throws this error, I need to re-start the program before trying to compile again.