LC Android deployment working on Windows 10 under ARM64

Andre Garzia andre at andregarzia.com
Wed Apr 8 11:09:24 EDT 2020


So, my main machine these days is a Surface Pro X which is a Microsoft
computer that runs Windows 10 with an ARM64 CPU (aka Windows on ARM, aka
WoA).

Machines running Windows 10 on ARM64 can run Windows 10 applications
compiled to ARM64 and also run Windows 10 applications compiled for x86
32bits through a built in emulation system. It can't run x86 64bits
applications unfortunately. Thankfully LC for Windows is still compiled for
32 bits, so I can run it on this machine even though I'd rather have a
native arm64 version someday.

I got tired of always switching to a Mac, or my older Surface Go, when I
need to do something with LC and Android and decided to try setting it up
today. I begun by following the instructions at:

http://lessons.livecode.com/m/4069/l/985962-livecode-and-android-studio

Which led me to download Android Studio for Windows 10 32bits. I've
installed it and downloaded SDKs for Android 10, 9 and 8. Also downloaded
the obsolete SDK tools as described. Downloaded a 32bits JDK from Oracle.
Installed everything and setup LC correctly.

While I was trying to deploy an Android app, it would start compile things
and then fail with:

"Could not encode class bundle"

Which is a useless message and doesn't tell me anything. I went searching
and found this thread:

http://runtime-revolution.278305.n4.nabble.com/could-not-encode-class-bundle-td4711848.html

Which led me to a very helpful message by Panos that contains this
wonderful nugget of wisdom:

> On Jan 22, 2017, at 8:42 AM, panagiotis merakos via use-livecode <[hidden
email]
<http://runtime-revolution.278305.n4.nabble.com/user/SendEmail.jtp?type=node&node=4711853&i=0>>
wrote:
>
> My guess is that this error is related to the Android SDK. Which version
of
> Android SDK Build Tools have you installed?
>
> To find the exact error, you can do the following:
>
> 1. Type in the msg box "edit the script of stack
revsaveasandroidstandalone"
> 2. In the script editor window that just opened, search for "Could not
> encode class bundle" (should be around line 638)
> 3. Add "answer the result" just before the "Could not encode class
bundle"
> line.
> 4. Click apply to (temporarily) save this change
> 5. Build an android standalone.

Now, why the hell doesn't the default error message contains "the result"?
That would have saved me a lot of time! I changed that to output to the
message box, and this is what it was saying:

-----
This version of
C:\Users\andre\AppData\Local\Android\Sdk\tools\lib\find_java64.exe is not
compatible with the version of Windows you're running. Check your
computer's system information and then contact the software publisher.

ERROR: No suitable Java found. In order to properly use the Android
Developer
Tools, you need a suitable version of Java JDK installed on your system.
We recommend that you install the JDK version of JavaSE, available here:
  http://www.oracle.com/technetwork/java/javase/downloads

If you already have Java installed, you can define the JAVA_HOME environment
variable in Control Panel / System / Avanced System Settings to point to the
JDK folder.

You can find the complete Android SDK requirements here:
  http://developer.android.com/sdk/requirements.html
-----

Which makes total sense because my computer can't actually run 64bits
binaries. I don't know which function in LC calls that command, it is not
in the revsaveandroidstandalone, but I noticed that in that folder there
was also a "find_java32.exe", I simply made a copy of it, renamed it
"find_java64.exe" and from then onwards, everything worked and I could
deploy and test things on Android.

So yes, LiveCode compiled for Windows 10 running under 32bits emulation on
an ARM64 computer, compiling for an ARM7 Android, all working fine.

PS: You can't do this kind of crazy stunts on a mac....

-- 
http://www.andregarzia.com -- All We Do Is Code.
http://fon.nu -- minimalist url shortening service.



More information about the use-livecode mailing list