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

Does it support IOS and Android? #50

Open
Personuo opened this issue Jul 14, 2023 · 6 comments
Open

Does it support IOS and Android? #50

Personuo opened this issue Jul 14, 2023 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@Personuo
Copy link

I want to use it in my project immediately, but I don't know if ios and android are supported?

@Personuo Personuo added the bug Something isn't working label Jul 14, 2023
@psydack
Copy link
Owner

psydack commented Jul 14, 2023 via email

@cholushkin
Copy link

I've just tested on android. It doesn't render anything. Later I'll check the logs

@cholushkin
Copy link

So the error is in loading cimgui.dll on android:

2023/08/11 16:37:47.683 18317 18338 Error Unity DllNotFoundException: Unable to load DLL 'cimgui'. Tried the load the following dynamic libraries: Unable to load dynamic library 'cimgui' because of 'Failed to open the requested dynamic library (0x06000000) dlerror() = dlopen failed: library "cimgui" not found
2023/08/11 16:37:47.683 18317 18338 Error Unity at ImGuiNET.ImGuiNative.igCreateContext (ImGuiNET.ImFontAtlas* shared_font_atlas) [0x00000] in <00000000000000000000000000000000>:0
2023/08/11 16:37:47.683 18317 18338 Error Unity at UImGui.UImGuiUtility.CreateContext () [0x00000] in <00000000000000000000000000000000>:0
2023/08/11 16:37:47.683 18317 18338 Error Unity at UImGui.UImGui.Awake () [0x00000] in <00000000000000000000000000000000>:0

@nukadelic
Copy link

nukadelic commented Nov 28, 2023

Same here works flawlessly inside the editor but won't render any uimgui once build ( app runs fine on its own ) tried including the .so with x86 & armv7 file from ImGui.NET-nativebuild/releases ( although I suspect the versions are way off ) , tried both mono and cpp build but still no luck , not very versed with native plugins , maybe someone could figure it out here are a few links I came across : DllNotFoundException on Android , Create a .jar from a .dll

Edit: also tied this older repository which you based yours on ? which had .so files , it's also doesn't work in build - nothing is getting renderer and the console complains about missing dll's as well.

@nukadelic
Copy link

Also tried building my own .so file without any luck so far

@noncom
Copy link

noncom commented Jan 18, 2024

Disclaimer: this is a guess.

I read the description of what you did by the link in your last comment, and I think it won't work like that in Unity.
The problem is likely that the code that requires the dll/so is inside the already built ImGui.NET.dll.
I suspect that in order for this to work, all the [DllImport] statements should be resolved and compiled directly by Unity itself.

If this guess is correct then you might probably have success with:

  • Copying the source form of the ImGui.NET, including the generated code into the Unity project
  • Copying the source code of uimgui (this project) into your Unity project
  • Reorganizing the positioning of cimgui according to the default Unity pattern of multiplatform native libraries (see the article referenced below)
  • Maybe doing something similar to all the other native dlls used by ImGui.NET and uimgui

In that case the whole project, including the linking information for the native libraries is going to be produced and managed by Unity, which should allow it to correctly include the libraries in the build, and be able to resolve them in runtime.

A brief article with generic steps, just for reference: https://matiaslavik.wordpress.com/2021/01/21/cross-platform-native-plugins-in-unity/

@psydack psydack added enhancement New feature or request and removed bug Something isn't working labels Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants