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

not working on ubuntu #43

Open
slimgabsi opened this issue Oct 12, 2018 · 26 comments · May be fixed by #106
Open

not working on ubuntu #43

slimgabsi opened this issue Oct 12, 2018 · 26 comments · May be fixed by #106

Comments

@slimgabsi
Copy link

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 gkngkc assigned gkngkc and unassigned gkngkc Oct 14, 2018
@gkngkc
Copy link
Owner

gkngkc commented Oct 14, 2018

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

@gkngkc gkngkc closed this as completed Oct 14, 2018
@gkngkc gkngkc reopened this Oct 14, 2018
@RicardoEPRodrigues
Copy link
Contributor

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

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

@M6stafa
Copy link

M6stafa commented Jan 2, 2019

@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
Copy link
Contributor

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
Copy link

M6stafa commented Jan 2, 2019

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
Copy link
Contributor

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
Copy link

M6stafa commented Jan 2, 2019

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

@RicardoEPRodrigues
Copy link
Contributor

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
Copy link

M6stafa commented Jan 2, 2019

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
Copy link
Contributor

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
Copy link

M6stafa commented Jan 2, 2019

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
Copy link
Contributor

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
Copy link
Contributor

@M6stafa
Copy link

M6stafa commented Jan 3, 2019

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
Copy link

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

@RicardoEPRodrigues
Copy link
Contributor

@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
Copy link

Vuxt4 commented Feb 12, 2019

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
Copy link
Contributor

@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
Copy link
Contributor

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
Copy link

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
Copy link
Contributor

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
Copy link

Sadly, nothing seems to change on 16.04.

@Vuxt4
Copy link

Vuxt4 commented Apr 15, 2019

@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
Copy link

Menci commented Jun 18, 2021

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
Copy link

Menci commented Jun 18, 2021

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 Menci linked a pull request Jun 18, 2021 that will close this issue
@Menci
Copy link

Menci commented Jun 18, 2021

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

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

Successfully merging a pull request may close this issue.

7 participants