Android Studio - Additional JDK not needed (Solution to Java is none error)

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Bernard
Posts: 351
Joined: Sat Apr 08, 2006 10:14 pm
Location: London, England

Re: Android Studio - Additional JDK not needed (Solution to Java is none error)

Post by Bernard » Sun Jun 20, 2021 2:28 pm

garmeister wrote:
Sun May 16, 2021 6:46 pm
Bernard,
I wanted to give you a big THANKS as well (at least for Win 10). Mac OS has been very troublesome with the hidden folder that Android SDK is installed in (able to workaround), the fact that there are TWO JavaVirtualMachines folders in the Mac OS (see attached pic from Eclipse IDE).

/Users/garychike/Library/Java/JavaVirtualMachines/
/Library/Java/JavaVirtualMachines/

Java SE 8, recommended by LiveCode, installs into the latter directory with no option to select the directory. LiveCode seems to direct itself, as you mentioned, to the OpenJDK which is located in the former directory and LiveCode will not accept the default Java 8 SDK directory probably due to Android Studio defaulting to the OpenJDK version. So it seems Android development on the Mac is dead in the water, at least for now.
Just to say that on my new Mac M1, having only installed Android Studio as the only software using Java, I do not have
Library/Java/JavaVirtualMachines/
in my the /Users folder hierarchy.
But there is
/Library/Java/Extensions/
/Library/Java/JavaVirtualMachines/
...but both of them are empty! So (at least in my case) these Java-related detritus in /Library are just noise.

However, there are also java, javac, etc. in /usr/bin/ (these are the same version as found in Android Studio, so I'm guessing they were installed by Android Studio).

It now works on M1 Mac/Big Sur. See last section of my post at the beginning of this thread.
Last edited by Bernard on Sun Jun 20, 2021 3:47 pm, edited 2 times in total.

Bernard
Posts: 351
Joined: Sat Apr 08, 2006 10:14 pm
Location: London, England

Re: Android Studio - Additional JDK not needed (Solution to Java is none error)

Post by Bernard » Sun Jun 20, 2021 2:34 pm

jacque wrote:
Mon May 17, 2021 5:18 pm
I've been creating Android apps on Mac regularly without any problems (I just did one yesterday.) I downloaded the SDK from Oracle and it installed into my user folder. I avoid Android Studio for the most part.

It looks like you have several versions of Java. I'd delete them all except the one that LC needs.
The problem is that Livecode tells users that the SDK-tools-only route was deprecated in the 8.1.5 timeline (red warning, top of page).
The most recent version of the Android SDK tools do not work with LiveCode. If you are using LiveCode 8.1.5 or later please install Android Studio as described in this lesson.
See here: https://lessons.livecode.com/m/2571/l/2 ... er-on-a-pc
Users are told to install Android Studio instead.

Klaus
Posts: 13793
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Android Studio - Additional JDK not needed (Solution to Java is none error)

Post by Klaus » Sun Jun 20, 2021 2:52 pm

Here the pathnames on my successfull Android Studio installation:
Android SDK -> /Users/klaus2/Library/Android/sdk
## I also used the trick with an ALIAS of that folder
JDK path -> /Applications/Android Studio.app/Contents/jre/jdk

Maybe that helps.

Bernard
Posts: 351
Joined: Sat Apr 08, 2006 10:14 pm
Location: London, England

Re: Android Studio - Additional JDK not needed (Solution to Java is none error)

Post by Bernard » Sun Jun 20, 2021 3:51 pm

I got it all working and I updated the first post in this thread. I guess I've now spent about 16 hours on debugging and fixing this in 2020 and 2021. And that is someone who's done shell scripting for 25 years, worked extensively with Java for 5 years, and 20 years with Livecode.

LC really need to sort this out. I've seen some users comment that they couldn't even follow my instructions above.

sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

Re: Android Studio - Additional JDK not needed (Solution to Java is none error)

Post by sphere » Tue Jun 22, 2021 9:38 pm

Take a look at B4A how beautiful they integrated this sh*t in their 100% free program (also for commercial use). Install Java JDK, install Android Studio, start B4X and add/upate all needed sdk from within, no need to open Android Studio.

LC could win so much users by making it even more easier, same counts for people with (code)signing and creating keys for iOs/Apple/Windows/Android apps, should been taking care of inside LC. For Apple it's now greatly taken care by Matthias, this was a job for LC in my humble opinion.

Bernard
Posts: 351
Joined: Sat Apr 08, 2006 10:14 pm
Location: London, England

Re: Android Studio - Additional JDK not needed (Solution to Java is none error)

Post by Bernard » Wed Jun 23, 2021 11:27 am

I agree that Livecode need to sort this out. It seems strange that they don't, given that one of the things that would draw new users to the IDE is the ability to produce apps for iOS/Android. It's claimed that most computing devices are no longer desktop, with Android being 72% of the non-desktop market.

The installation/setup instructions provided by Livecode for Android development are a mess. Some advanced users (e.g. Jacque and Andre) have no trouble setting up their development environment using techniques that deviate significantly from what Livecode recommend. I have tried here to help Livecode find a way to setup Android development in a cross-platform way using only the LC IDE and what comes with Android Studio. What I've done here would probably be off-putting for new users who don't know how to delve into the innards of the LC IDE, who don't know what's going on behind the scenes with the compilation to APK process.

I can't help but feel that the philosophy of offering easy development for Android is seen by new users as a false claim when they can't get LC/AS setup without numerous errors and dead-ends. The Livecode Lesson refers to LC 9.6.1, so it's not that old. https://lessons.livecode.com/m/2571/l/6 ... oid-studio

I guess what B4X has in their favour is that their tools are already heavily integrated with Java. Unfortunately for me a) I'm tired of learning new environments/languages b) I am developing something that needs the late-binding that comes with Livecode.

sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

Re: Android Studio - Additional JDK not needed (Solution to Java is none error)

Post by sphere » Wed Jun 23, 2021 10:14 pm

SOme people manage to still use only the command line for the Android SDK, the older version had a small GUI to just install the needed.
For new commers, install android studio plus the needed sdk's, install java jdk and keep track where i is installed, install LC and set the correct installation folder for the Java jdk.

BX4 uses a BASIC kind of language, but seems to rewrite it all to java internally.
For my project (for the mobile part) I still have to make up my mind if I'm going to use Flutter (which I'm also playing with) or B4X, it will not be LC unfortunately. It could have saved me time.

ckacadv
Posts: 3
Joined: Wed Jul 26, 2023 1:26 am
Contact:

Re: Android Studio - Additional JDK not needed (Solution to Java is none error)

Post by ckacadv » Sun Dec 03, 2023 2:47 pm

Hi, i'm using LiveCode 9 .6 .1 and android studio giraffe. I installed sdk from android studio and i have set sdk path in livecode to
C:\Users\ (username) \AppData\Local\Android\Sdk
Livecode is not complaining about that but it says jdk path is none and when i try to save as standalone android app i get error "Could not compile service support class". I just don't know what to do anymore.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7210
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Android Studio - Additional JDK not needed (Solution to Java is none error)

Post by jacque » Mon Dec 04, 2023 7:10 pm

Studio installs a newer version of Java. LC needs Java 1.8. Check the versions you have and delete anything newer.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Klaus
Posts: 13793
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Android Studio - Additional JDK not needed (Solution to Java is none error)

Post by Klaus » Mon Dec 04, 2023 8:01 pm

You mean JAVA 8, right?

SparkOut
Posts: 2834
Joined: Sun Sep 23, 2007 4:58 pm

Re: Android Studio - Additional JDK not needed (Solution to Java is none error)

Post by SparkOut » Mon Dec 04, 2023 11:26 pm

Java SDK v 1.8

Klaus
Posts: 13793
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Android Studio - Additional JDK not needed (Solution to Java is none error)

Post by Klaus » Tue Dec 05, 2023 10:05 am

Ah, sorry, misunderstood this.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9801
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Android Studio - Additional JDK not needed (Solution to Java is none error)

Post by FourthWorld » Wed Dec 06, 2023 1:01 am

sphere wrote:
Tue Jun 22, 2021 9:38 pm
Take a look at B4A how beautiful they integrated this sh*t in their 100% free program (also for commercial use). Install Java JDK, install Android Studio, start B4X and add/upate all needed sdk from within, no need to open Android Studio.

LC could win so much users by making it even more easier, same counts for people with (code)signing and creating keys for iOs/Apple/Windows/Android apps, should been taking care of inside LC. For Apple it's now greatly taken care by Matthias, this was a job for LC in my humble opinion.
Well said.

But I doubt anyone with decision-making authority will ever see your words.

I communicate weekly with the leaders of so many vendors across social media, from software companies to game publishers to the CEO of Netflix and Grady freaking Booch. But in this era where marketing is a conversation with fans, I can't recall the last time Kevin just hung out with his audience, even in his own venues.

But you're right. If you're selling a tool on ease of use, ease of use is the priority.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

Re: Android Studio - Additional JDK not needed (Solution to Java is none error)

Post by sphere » Wed Dec 06, 2023 9:18 pm

Hi, long time no see :)

Thanks!
Next to that if you image that (as far as I know) B4X is developed by 1 man only. And what its capable of.

Livecode was for me the easiest and fastest to develop, but missing some stuff. If you dive into Flutter or B4X, one gets the hang of it pretty fast.
Disadvantage of Flutter is that one often seems to be updating its code after updates due to breaking changes. But it runs really smooth on each platform. And both costs nothing (except a very low amount for B4X for iOs).

I hope that the team will add such implementations. I really loved Livecode.

Post Reply

Return to “Android Deployment”