Common Android Deployment issues

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

andyh1234
Posts: 476
Joined: Mon Aug 13, 2007 4:44 pm
Contact:

Re: Common Android Deployment issues

Post by andyh1234 »

I am stuck trying to test an app, I have had this working on this system before but just returned from a 6-month break in coding.

When I try to test an app (after launching and selecting an emulator as a test target), I get an error 'Unable to build app for testing: could not encode bundle - error: Exception in thread "main.java.lang.UnsupportedClassVersionError com/android/tools/r8/D8 has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

I have reinstalled Java V8 and uninstalled (as far as I can see) any other versions of Java.

Just totally stuck at this point.
SparkOut
Posts: 2984
Joined: Sun Sep 23, 2007 4:58 pm

Re: Common Android Deployment issues

Post by SparkOut »

Sounds like the build tools version is too high
https://forums.livecode.com/viewtopic.p ... 32#p223332

Or maybe it doesn't like a 64 bit build?
andyh1234
Posts: 476
Joined: Mon Aug 13, 2007 4:44 pm
Contact:

Re: Common Android Deployment issues

Post by andyh1234 »

I tried this but to no avail. I turned off everything but the x86 build and also made sure the emulator was x86 and API30, no luck.
SparkOut
Posts: 2984
Joined: Sun Sep 23, 2007 4:58 pm

Re: Common Android Deployment issues

Post by SparkOut »

Just to be clear, I meant not just selecting the API level in the standalone settings, but in the actual android SDK folder, you do also need to ensure the build tools folder has all the higher level ones renamed (or deleted) so the build process can't find the higher level tools at all. I had to fiddle quite a lot before "it just worked".
andyh1234
Posts: 476
Joined: Mon Aug 13, 2007 4:44 pm
Contact:

Re: Common Android Deployment issues

Post by andyh1234 »

Thanks, I've tried deleting everything I can see higher than 30 in the ~/Library/Android/sdk folder (and sub folders) and still get the same error.

Also, in the Livecode mobile support preferences pane, there is a title for JDK path, but no box below it, or no way to scroll down to see a box (it would be hidden off screen). Am I missing something there.
jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7423
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Common Android Deployment issues

Post by jacque »

Do you have Build Tools 30.0.3 installed? That's what LC recommends. Also check that the java path in LC mobile preferences shows JDK 1.8. The Java path is automatically detected by LC so there is no way to edit it. On a Mac it looks like this:
JDK Path: /Library/Java/JavaVirtualMachines/jdk-1.8.jdk
The installation is in the Java folder at the root level of the hard drive, not the Android SDK folder.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
andyh1234
Posts: 476
Joined: Mon Aug 13, 2007 4:44 pm
Contact:

Re: Common Android Deployment issues

Post by andyh1234 »

Yes, I have build tools 30.0.3 installed.

Is there was way to view the JDK path using a command as the box it should be in is out of the display window on my Mac.

In /Library/Java/JavaVirtualMachines I only have one folder called jdk-1.8.jdk
jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7423
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Common Android Deployment issues

Post by jacque »

I'm not sure why you can't see the Java path, it should be to the right of the label. If that is empty then LC can't find your Java installation. Here is mine:
Attachments
Screen Shot 2023-08-04 at 1.43.29 PM.png
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
andyh1234
Posts: 476
Joined: Mon Aug 13, 2007 4:44 pm
Contact:

Re: Common Android Deployment issues

Post by andyh1234 »

I have got a bit further with this by restoring an old windows PC I have and installation everything from scratch.

I get past the java error message now on the windows PC, but get a message at the last minute 'Installation of app failed: [BT:1.8.0] Error: File:'c:\users\andre\AppData\Local\Temp\tmp8.apks' was not found. Followed by a lot of java exceptions saying the same thing.

Any idea why this file would not be created, it looks like it is the final step before it is installed on the device.
jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7423
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Common Android Deployment issues

Post by jacque »

I can't answer since I've never seen any of those errors, but it would be a good question for support. What's happening isn't normal. If you solve it, please let us know here for future reference. https://quality.livecode.com
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
andyh1234
Posts: 476
Joined: Mon Aug 13, 2007 4:44 pm
Contact:

Re: Common Android Deployment issues

Post by andyh1234 »

Thanks, ive posted these as bugs, lets see what Livecode come back with (if anything)
libuda
Posts: 8
Joined: Thu May 13, 2021 6:42 pm

Re: Common Android Deployment issues

Post by libuda »

Is there a solution for this problem? I got exactly the same errors.
andyh1234
Posts: 476
Joined: Mon Aug 13, 2007 4:44 pm
Contact:

Re: Common Android Deployment issues

Post by andyh1234 »

On my PC I can work around the issue by creating a key and signing the app with my key, then choose build standalone to create an apk file. Copy this file to your device (I use Google drive for this) and install it.

It's long winded but it works for me. I still cant deploy as a test straight to the simulator or device.
libuda
Posts: 8
Joined: Thu May 13, 2021 6:42 pm

Re: Common Android Deployment issues

Post by libuda »

It seems that the link is not working :?:
Can you send a private message?
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Common Android Deployment issues

Post by Klaus »

Seems not to work or does not actually work? 8)
libuda wrote: Thu Sep 07, 2023 2:50 pmIt seems that the link is not working :?:
Can you send a private message?
Both of the URLs (links) on this page do in fact work, just tested!
Which one are you referring to?
Post Reply