Page 6 of 7

Re: Common Android Deployment issues

Posted: Thu Aug 03, 2023 4:12 pm
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.

Re: Common Android Deployment issues

Posted: Thu Aug 03, 2023 4:46 pm
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?

Re: Common Android Deployment issues

Posted: Thu Aug 03, 2023 7:50 pm
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.

Re: Common Android Deployment issues

Posted: Thu Aug 03, 2023 8:48 pm
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".

Re: Common Android Deployment issues

Posted: Thu Aug 03, 2023 9:44 pm
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.

Re: Common Android Deployment issues

Posted: Thu Aug 03, 2023 10:26 pm
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.

Re: Common Android Deployment issues

Posted: Thu Aug 03, 2023 11:48 pm
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

Re: Common Android Deployment issues

Posted: Fri Aug 04, 2023 7:45 pm
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:

Re: Common Android Deployment issues

Posted: Sat Aug 05, 2023 3:11 pm
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.

Re: Common Android Deployment issues

Posted: Sat Aug 05, 2023 5:16 pm
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

Re: Common Android Deployment issues

Posted: Mon Aug 07, 2023 6:19 pm
by andyh1234
Thanks, ive posted these as bugs, lets see what Livecode come back with (if anything)

Re: Common Android Deployment issues

Posted: Tue Sep 05, 2023 7:55 am
by libuda
Is there a solution for this problem? I got exactly the same errors.

Re: Common Android Deployment issues

Posted: Tue Sep 05, 2023 1:15 pm
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.

Re: Common Android Deployment issues

Posted: Thu Sep 07, 2023 2:50 pm
by libuda
It seems that the link is not working :?:
Can you send a private message?

Re: Common Android Deployment issues

Posted: Thu Sep 07, 2023 2:55 pm
by Klaus
Seems not to work or does not actually work? 8)
libuda wrote:
Thu Sep 07, 2023 2:50 pm
It 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?