Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No driver found for wx #7

Open
Nicd opened this issue Aug 26, 2022 · 6 comments
Open

No driver found for wx #7

Nicd opened this issue Aug 26, 2022 · 6 comments

Comments

@Nicd
Copy link

Nicd commented Aug 26, 2022

My app immediately crashes on startup with

20:39:12.827 [error] ERROR: Could not find 'wxe_driver.so' in: /data/user/0/io.elixirdesktop.example/files/app/lib/wx-2.2/priv
20:39:12.834 [notice] Application desktop exited: Desktop.start(:normal, []) returned an error: shutdown: failed to start child: Desktop.Env
        ** (EXIT) an exception was raised:
            ** (ErlangError) Erlang error: {:load_driver, 'No driver found'}
                (wx 2.2) wxe_server.erl:65: :wxe_server.start/1
                (wx 2.2) wx.erl:115: :wx.new/1
                (desktop 1.4.1) lib/desktop/env.ex:28: Desktop.Env.init/1
                (stdlib 4.0.1) gen_server.erl:848: :gen_server.init_it/2
                (stdlib 4.0.1) gen_server.erl:811: :gen_server.init_it/6
                (stdlib 4.0.1) proc_lib.erl:240: :proc_lib.init_p_do_apply/3

Everything builds correctly though.

@Nicd
Copy link
Author

Nicd commented Aug 26, 2022

This was due to the run_mix script stripping all *.so files from the built app.zip. When I include the library, I'm getting

20:52:44.691 [error] WX ERROR: Could not load library: :load_failed
    Failed to load NIF library /data/user/0/io.elixirdesktop.example/files/app/lib/wx-2.2/priv/wxe_driver: 'dlopen failed: "/data/data/io.elixirdesktop.example/files/app/lib/wx-2.2/priv/wxe_driver.so" has bad ELF magic: cffaedfe'

so I'm guessing there was a reason for the stripping.

@dominicletz
Copy link
Contributor

There seems to be something wrong with how the release is built. wxWidgets WebView is not available on the phones and thus the sample app is packaging a drop-in-replacement package "bridge" that is using the phones native webview. Try to replace :wx with bridge in your release build, and then it should work.

@dominicletz
Copy link
Contributor

This is the relevant part in the desktop library: https://github.com/elixir-desktop/desktop/blob/dc1575c1963950ff18b2682a3fdb1887ac3a9ffa/mix.exs#L87

@Nicd
Copy link
Author

Nicd commented Aug 26, 2022

Thanks, that does it! I guess it should be added to instructions somewhere. I can make a PR later, I'm now trying to get this to work.

Btw is there a chat avenue for this library? It would be possibly faster / lower friction than talking in the issues. :) If you use Discord, we could make a separate #elixir-desktop channel on the Elixir server.

@dominicletz
Copy link
Contributor

It's the #desktop channel on the Elixir slack https://join.slack.com/t/elixir-lang/shared_invite/zt-1f13hz7mb-N4KGjF523ONLCcHfb8jYgA

@Nicd
Copy link
Author

Nicd commented Aug 26, 2022

I guess I need to rejoin Slack then. :)

I have just gotten the app to run for the first time! This is glorious! Thanks so much. <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants