Android error: Could not compile service support class

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Zood
Posts: 37
Joined: Mon Apr 24, 2017 7:17 pm

Android error: Could not compile service support class

Post by Zood » Tue Nov 14, 2017 2:36 pm

Hey everyone,

My first time (trying) to deploy to Android and not going well so far..
I managed to exclude inclusions which are not supported by Android like Ask/Answer-dialogs but i keep getting a specific error whilst trying to build the standalone:
"There was an error while saving the standalone application Could not compile service support class"

Any ideas on what this could be?


Thanks in advance!

MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: Android error: Could not compile service support class

Post by MaxV » Tue Nov 14, 2017 4:30 pm

This is probably the most common error message – it generally occurs when your Android settings in LiveCode are not quite right. If you want to deploy your LiveCode app to an Android device, then you will need to install the Java SDK and the Android SDK on your machine.

See: http://livecode.wikia.com/wiki/Android_ ... enviroment
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Zood
Posts: 37
Joined: Mon Apr 24, 2017 7:17 pm

Re: Android error: Could not compile service support class

Post by Zood » Tue Nov 14, 2017 5:13 pm

I appreciate your fast answer!

By "Android settings in LiveCode" I assume you are referring to both the Android SDK settings in Livecode
Livecode settings.jpeg
and the Android SDK settings in Android Studio.
android studio settings2.jpeg
Is there a faulty setting somewhere or am I forgetting something?
Thanks in advance!

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm
Location: McKenna, WA

Re: Android error: Could not compile service support class

Post by quailcreek » Tue Nov 14, 2017 11:09 pm

I'm not sure if Studio wants java 9. Try installing java 8 and see if you still have a problem.
Tom
MacBook Pro OS Mojave 10.14

Zood
Posts: 37
Joined: Mon Apr 24, 2017 7:17 pm

Re: Android error: Could not compile service support class

Post by Zood » Wed Nov 15, 2017 2:01 pm

And how would I install Java 8?
I tried installing Java 8 through their website except whenever I link the
Android SDK in the livecode settings it jumps to the same settings as I mentioned earlier.

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm
Location: McKenna, WA

Re: Android error: Could not compile service support class

Post by quailcreek » Wed Nov 15, 2017 9:57 pm

Read thru this thread. It's what I went thru when I had the same problem. About half way down I explain about the java folder problem that fix this.

http://forums.livecode.com/viewtopic.php?f=53&t=29660
Tom
MacBook Pro OS Mojave 10.14

Zood
Posts: 37
Joined: Mon Apr 24, 2017 7:17 pm

Re: Android error: Could not compile service support class

Post by Zood » Sat Nov 25, 2017 1:24 pm

Thanks for the thread!
I have uninstalled and reinstalled JAVA, Android studio and livecode in general to hopefully fix the problem but still no luck.
Java SDK still jumps to the 9.0.1 version whenever I link it to livecode
any suggestions i could try?

Zood
Posts: 37
Joined: Mon Apr 24, 2017 7:17 pm

Re: Android error: Could not compile service support class

Post by Zood » Sun Nov 26, 2017 5:37 pm

Update: found the issue!
I had installed java sdk 9, downgraded to 8 but did not remove the whole package..
LC automagically took the newest version so I deleted the sdk9-location using terminal:
sudo rm -fr /Library/Java/JavaVirtualMachines/jdk-9.0.1jdk/

LC now used sdk 8 and everything works like a charm
Thanks to all who helped!

asayd
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 107
Joined: Mon Apr 10, 2006 7:02 pm
Location: Provo, Utah, USA
Contact:

Re: Android error: Could not compile service support class

Post by asayd » Wed Dec 05, 2018 6:15 pm

Thanks for posting your solution, @Zood. One year on, I had the same problem, and your solution fixed it.
Devin Asay
Learn to code with LiveCode University
https://livecode.com/store/education/

SoapDog
Posts: 84
Joined: Sun Apr 09, 2006 10:03 pm
Location: Niterói, RJ
Contact:

Re: Android error: Could not compile service support class

Post by SoapDog » Fri Mar 26, 2021 3:04 pm

Just bumping this thread as it is happening for me now in a Macbook Air M1 with:

* Android Studio installed.
* SDK with API level 29 installed.
* Platform tools installed.
* JDK16 installed.

All detected correctly by the IDE. Be aware that JDK 16 is the only M1 native SDK, there is no earlier SDK for macOS M1.
http://www.andregarzia.com

bwmilby
Posts: 438
Joined: Wed Jun 07, 2017 5:37 am
Location: Henrico, VA
Contact:

Re: Android error: Could not compile service support class

Post by bwmilby » Fri Mar 26, 2021 11:10 pm

JDK may be an issue. I know that I'm still running JDK 8 (jdk1.8.0_231). I've been "scared" to try to update it due to experiences I've read about (and that was just that JDK 9 didn't seem to work). I'm also stuck at Catalina for now due to some other software that I use.
Brian Milby

Script Tracker https://github.com/bwmilby/scriptTracker

PaulDaMacMan
Posts: 616
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: Android error: Could not compile service support class

Post by PaulDaMacMan » Wed Aug 25, 2021 2:27 am

bwmilby wrote:
Fri Mar 26, 2021 11:10 pm
JDK may be an issue. I know that I'm still running JDK 8 (jdk1.8.0_231). I've been "scared" to try to update it due to experiences I've read about (and that was just that JDK 9 didn't seem to work). I'm also stuck at Catalina for now due to some other software that I use.
Hi Brian, what sort of experience did you have with JDK 9? I just re-setup Android building and used one of the OpenJDK 8's, I can build and install APKs, but some things don't seem to be working properly. I'm thinking I need to (register with Oracle to) get the correct JDK.
My GitHub Repos: https://github.com/PaulMcClernan/
Related YouTube Videos: PlayList

bwmilby
Posts: 438
Joined: Wed Jun 07, 2017 5:37 am
Location: Henrico, VA
Contact:

Re: Android error: Could not compile service support class

Post by bwmilby » Wed Aug 25, 2021 2:45 am

I never actually tried 9 but got the Oracle version of 8.
Brian Milby

Script Tracker https://github.com/bwmilby/scriptTracker

PaulDaMacMan
Posts: 616
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: Android error: Could not compile service support class

Post by PaulDaMacMan » Wed Aug 25, 2021 3:00 am

bwmilby wrote:
Wed Aug 25, 2021 2:45 am
I never actually tried 9 but got the Oracle version of 8.
OK thanks!
My GitHub Repos: https://github.com/PaulMcClernan/
Related YouTube Videos: PlayList

mtalluto
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 125
Joined: Tue Apr 11, 2006 7:02 pm
Location: Seattle, WA
Contact:

Re: Android error: Could not compile service support class

Post by mtalluto » Thu Oct 13, 2022 6:30 pm

I set up an M1 Macbook Pro yesterday to build Android apps with LiveCode.
I hope this information is useful to others looking to build Android apps with this setup.
If anyone gets stuck anywhere, let me know, and I will update this information with more details.

My goal is not only to be able to build for the Google Play Store but to run emulators for testing.
I found the specific settings in Android Studio needed to make LiveCode and the emulators work together.
Much of this applies to Windows as it does to Mac as the setting are managed in Android Studio. My pathing instructions below are for Mac only because it is trivial to see invisible folders on Windows. On Mac, if you want to use Finder, you will need to use the terminal to reveal invisible folders. You can use the terminal directly as another option if you are comfortable with that. Alternatively, you can use 3rd party finder tools. I favor ForkLift these days. You can quickly reveal invisible content and use a GUI that is Finder-like.

Android Studio About Screen Details
Android Studio Chipmunk | 2021.2.1 Patch 2
Build #AI-212.5712.43.2112.8815526, built on July 10, 2022
Runtime version: 11.0.12+0-b1504.28-7817840 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 12.5.1
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 10
Registry: external.system.auto.import.disabled=true

Oracle JAVA installer: jdk-8u341-macosx-x64
Oracle JAVA SDK version: 1.8.0_341
Oracle JAVA JDK version: 1.8.0_341
(I decided to make LiveCode happy by following the guidance to use Java 8 SDK installer even though I am using an M1 (Apple Silicon) system. Since I can do what I want, I think it is safe to stay with this guidance.)

LiveCode 9.6.9 rc 1

In Android Studio/SDK Manager (You may need to uncheck 'Hide Obsolete Packages' in the bottom right of this screen)
SDK Platforms tab
Android 12.0 (S), API 31, Revision 1
Android 11.0 (R), API 30, Revision 3
(Both of these are installed. All others are uninstalled)

SDK Tools tab
30.0.3

In the emulator section, you need to build the emulator using Android 11 (R), API 30
This will allow you to use the Test functionality in LiveCode.
Notice that my JDK path does not show a value in the LiveCode preferences. It does not seem to affect developing for Android.

Pointing LiveCode to the Java SDK can be simplified by making an alias of the '/Users/Mark/Library/Android/sdk' folder.
Copy the alias to your Mac desktop. Point LiveCode to that folder. After you do this, you can delete the alias folder.
If you want to use the Finder to navigate to your SDK folder, you will need to reveal invisible items (temporarily).
Copy and paste each line, one at a time, into your terminal windows. Press the return key and do the next line.

To see your invisible files and folders:
defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder

To return your Finder back to normal
defaults write com.apple.finder AppleShowAllFiles FALSE
killall Finder

Image
Image
Image
Image
Mark Talluto
--
Canela
design - develop - deploy: https://appli.io
Database and Cloud for LiveCode Developers: https://livecloud.io
Company: https://canelasoftware.com

Post Reply

Return to “Android Deployment”