elixir-desktop / android-example-app

Android Studio project wrapper around the Elixir TodoApp Desktop app to run on Android including the Erlang runtime
MIT License
102 stars 10 forks source link

update erlang 25.4 -> 26.2 #10

Open thehaigo opened 2 months ago

thehaigo commented 2 months ago

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?

dominicletz commented 2 months ago

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.

thehaigo commented 2 months ago

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 commented 2 months ago

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

https://github.com/thehaigo/desktop_setup

dominicletz commented 2 months ago

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
thehaigo commented 2 months ago

work it! thank you!

I tried jar command, but not works 😢

I'll create a PR later.