gkngkc / UnityStandaloneFileBrowser

A native file browser for unity standalone platforms
MIT License
2.01k stars 317 forks source link

not working on ubuntu #43

Open slimgabsi opened 5 years ago

slimgabsi commented 5 years ago

Failed to load module "canberra-gtk-module"

test_64:8755): GLib-GObject-WARNING **: 12:30:42.739: cannot register existing type 'GdkDisplayManager'

(test_64:8755): GLib-CRITICAL **: 12:30:42.739: g_once_init_leave: assertion 'result != 0' failed

(test_64.x86_64:8755): GLib-GObject-CRITICAL **: 12:30:42.739: g_object_new_with_properties: assertion 'G_TYPE_IS_OBJECT (object_type)' failed

gkngkc commented 5 years ago

Unfortunately I can't help much about this because i don't know much about gtk. You probably find more healthy information on internet.

RicardoEPRodrigues commented 5 years ago

What is your OS? What DE are you using? Graphics drivers?

Can you upload the Logs (terminal and Unity Player)?

M6stafa commented 5 years ago

@RicardoEPRodrigues, I have this problem too. I'm checking it on virtual machine (vmware). The program got stuck and the following errors printed in terminal.

image

RicardoEPRodrigues commented 5 years ago

Hello @M6stafa,

Can you try it on Ubuntu 18.04? (maybe is a problem with the version of GLib, the current libStandaloneFileBrowser.so is compiled on 18.04.

The program got stuck

Can you check that the window is not behind the program? It happened to me and is related to how GNOME sorts windows out.

M6stafa commented 5 years ago

Can you try it on Ubuntu 18.04? (maybe is a problem with the version of GLib, the current libStandaloneFileBrowser.so is compiled on 18.04.

Do you have old builds? or can you say me how i must build it? I'm not the only user of this program, and ubuntu 14.04 is good if supported but 16.04 must be supported.

Can you check that the window is not behind the program? It happened to me and is related to how GNOME sorts windows out.

I check that, there is nothing. i also check the sync function.

RicardoEPRodrigues commented 5 years ago

i also check the sync function.

Currently there is no async working, I only implemented the sync method where the async calls the sync function.

can you say me how i must build it?

You can use CMake to build the library. It is located in the Plugins folder of the project.

M6stafa commented 5 years ago

I test in ubuntu 18.04 too, and it fails with same error, what was your test environment?

RicardoEPRodrigues commented 5 years ago

What version of Unity are you using? Maybe this is the issue.

A little context, I'm using Unity 2017.2 (I think), on this version the engine initializes a Gtk Application, so when in the library I open a dialog window it just uses the application Unity created. My hypothesis is that newer version don't run a Gtk Application, meaning we don't really have a correct way to create a dialog window.

To test my hypothesis I would need to install a newer version of Unity... or you can try and modify the code I made. Were you able to compile it?

M6stafa commented 5 years ago

I'm using 2018.3.0f2.

Were you able to compile it?

I'm trying, it's need a newer cmake that is not in default repos, i make the the newer version. What code must i change and test?

RicardoEPRodrigues commented 5 years ago

First try compiling it and replacing the .so file in the Assets/Plugins folder and test it in your game (you need to close and open Unity to load the new .so file). Does it work? Same errors or different errors?

If it doesn't work then try running the example that comes with the library code (main.c). Does it run? Does it show the same errors?

M6stafa commented 5 years ago

I build in Ubuntu 16.04, the main.c runs correctly without any error but the game has same errors with new .so

What is next step?

RicardoEPRodrigues commented 5 years ago

Basically we now know that Unity no longer runs with a Gtk application. So we need to create one.

AKA

Create a Gtk application from the C code.

RicardoEPRodrigues commented 5 years ago

Maybe this can help. https://developer.gnome.org/gtk3/stable/gtk-getting-started.html

M6stafa commented 5 years ago

I try some methods like create a gtk application each time, but errors not change. at the end I find TinyFileDialogs and build it for linux and it's work correctly.

marco-nutonomy commented 5 years ago

Still no updates on this? I have the same problem.

RicardoEPRodrigues commented 5 years ago

@marco-nutonomy I still haven't had the time.

Yet the problem is now clearer, it doesn't work on the 2018 version of Unity.

Vuxt4 commented 5 years ago

I am facing the same issue, it works in the Editor, but crashes in build.


But after trying out for few hours, it seems to work, though I am not a Gtk expert so not sure what it would cause LOL ! I haven't tested all the functions, but this is how I managed to get it to work on my side, hope this will give you some hints...

OS: Ubuntu 14.04 Unity: 2018.3.0f2

  1. Installing gtk2.0 sudo apt-get install libgtk2.0-dev

  2. Downgrade to gtk2.0 and recompile the library seems to work (see attached file for modified CMakeList.txt) CMakeLists.txt

Hope there will be a proper solution soon.

RicardoEPRodrigues commented 5 years ago

@Vuxt4 Thank you for your insight, I'll need to test this out, yet I'm not a fan of using older versions where newer versions should (in theory) do the job.

If all else fails I'll have to compile it with GTK2.0. Thank you! 😄

RicardoEPRodrigues commented 5 years ago

Hey everyone, so I've done some digging. It turns out it is not related with Unity 2018, it is instead related with older Ubuntu distros.

I've been developing and building on Ubuntu 18.04, where even with Unity 2018 it works, I think the problems are due to older GTK version in Ubuntu 14.04. I don't have the time or availability to solve this issue. I can only support newer distros.

marco-nutonomy commented 5 years ago

I can understand not supporting 14.04 which is almost at the end of the LTS, but i think 16.04 should definitely be supported, considering it still has more than 2 years of official support.

RicardoEPRodrigues commented 5 years ago

Hey guys, I compiled the code in Ubuntu 14.04 and generated the .so.

Could you test it out and see if it works for you?

libStandaloneFileBrowser.zip

Replace the .so file in your Unity project with this one and give it a go.

marco-nutonomy commented 5 years ago

Sadly, nothing seems to change on 16.04.

Vuxt4 commented 5 years ago

@RicardoEPRodrigues

Your new .so works fine while in Editor, it does not work in build application though...

Following error occurs when running with build application: (test.x86_64:4785): GLib-GObject-WARNING **: cannot register existing type 'GdkDisplayManager'

(test.x86_64:4785): GLib-CRITICAL **: g_once_init_leave: assertion 'result != 0' failed

(test.x86_64:4785): GLib-GObject-CRITICAL **: g_object_new: assertion 'G_TYPE_IS_OBJECT (object_type)' failed

Environment: OS: Ubuntu 14.04 Unity: 2018.3.0f2

Menci commented 3 years ago

I rebuilt the .so file but it still doesn't working.

Both the bundled and the one built by myself stuck on gtk_init:

image

Menci commented 3 years ago

I managed to get it running with a GTK+ running in a separated process. I'll post the source code (or send a pull request) later!

Menci commented 3 years ago

I opened a PR #106. Before it's merged you can get the new native lib from my repo.