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: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Bernard
Posts: 297
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: 297
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: 12413
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: 297
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: 1136
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: 297
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: 1136
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.

Post Reply

Return to “Android Deployment”