android-example-app icon indicating copy to clipboard operation
android-example-app copied to clipboard

update erlang 25.4 -> 26.2

Open thehaigo opened this issue 1 year ago • 5 comments

build erlang 26.2 by runtime replace app/assets's runtime files and run but below error

["beam/beam_load.c(190): Error loading module application_controller:\n  This BEAM file was compiled for a later version of the runtime system than the current (Erlang/OTP 25).
To fix this, please re-compile this module with an Erlang/OTP 25 compiler.
(Use of opcode 181; this emulator supports only up to 180.)

I suspect that not only the runtime update but also an update of libs/erlang.jar is necessary. How is erlang.jar created?

thehaigo avatar Sep 09 '24 04:09 thehaigo

It is created using the runtimes github repo: https://github.com/elixir-desktop/runtimes

Happy to help with that. And let me know if you have ideas of how to make this easier.

dominicletz avatar Sep 10 '24 22:09 dominicletz

I have had no problems creating the following files using

arm64-v8a-runtime.zip armeabi-v7a-runtime.zip x86_64-runtime.zip

but erlang.jar not created https://github.com/elixir-desktop/android-example-app/blob/master/app/libs/erlang.jar

thehaigo avatar Sep 11 '24 00:09 thehaigo

Although not runtime, I have created a library to easily create app projects

https://github.com/thehaigo/desktop_setup

thehaigo avatar Sep 11 '24 00:09 thehaigo

Yeah, previously I've done the last step manually but it's quite straight forward. (would love a PR for that)

  1. Extract the three runtime zip files into their own directories.
  2. Create a new lib directory and copy the files with prefixes arm64-v8a | armeabi-v7a | x86_64 respectively into lib
  3. zip the lib directory and rename to erlang.jar

The result should then have this layout:

$ zipinfo -2 ./app/libs/erlang.jar
lib/
lib/arm64-v8a/
lib/arm64-v8a/liberlang.so
lib/arm64-v8a/lib__erl_child_setup.so
lib/arm64-v8a/lib__inet_gethost.so
lib/armeabi-v7a/
lib/armeabi-v7a/liberlang.so
lib/armeabi-v7a/lib__inet_gethost.so
lib/armeabi-v7a/lib__erl_child_setup.so
lib/x86_64/
lib/x86_64/liberlang.so
lib/x86_64/lib__erl_child_setup.so
lib/x86_64/lib__inet_gethost.so

dominicletz avatar Sep 11 '24 00:09 dominicletz

work it! thank you!

I tried jar command, but not works 😢

I'll create a PR later.

thehaigo avatar Sep 11 '24 00:09 thehaigo

Hey I've done a major update to the runtimes and will update this projects structure soon following that and using static linking

dominicletz avatar Mar 07 '25 17:03 dominicletz