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

Support for Android packaging #4

Open
Ayliroe opened this issue May 15, 2023 · 10 comments
Open

Support for Android packaging #4

Ayliroe opened this issue May 15, 2023 · 10 comments

Comments

@Ayliroe
Copy link

Ayliroe commented May 15, 2023

Hey,

Love your wrapper! I've been using it for a while in Win64 packages and it works great.
I see you've made some changes recently toward supporting other platforms, would you mind extending that to include a prebuilt Android lib?
I'm a little over my head when I try to do that myself, trying to understand errors like "cannot open [...]/Plugins/UnrealFastNoise2/Source/ThirdParty/FastNoise2/Win64/Release: Is a directory", or how to get a FastNoise.lib for Android (using CMake I presume?).

Cheers!

@DoubleDeez
Copy link
Owner

DoubleDeez commented May 16, 2023

Oh right, Android (like Linux) probably uses .so/.a files.

I'm not setup to build Android but here's my thoughts:

You'll need to follow FastNoise2's docs to compile for Android.

In /Source/ThirdParty/FastNoise2 you'll need to add an Android folder with Release and Debug subfolders and add the files you compiled in the last step.

You'll also need to update the include files in /Source/ThirdParty/FastNoise2/include with the ones you used to build FastNoise2.

Then you'll need to modify /Source/ThirdParty/FastNoise2/FastNoise2.build.cs with a special case when (Target.Platform == UnrealTargetPlatform.Android) to add the .so files instead of .dll and .a instead of the .lib.

If you get this working, please make a PR so we can have it available for everyone.

@DoubleDeez
Copy link
Owner

@Ayliroe I made a new branch (https://github.com/DoubleDeez/UnrealFastNoise2/tree/multi-platform-support) with some changes to FastNoise2.build.cs that will hopefully support Android.

Try pulling it, creating an Android folder in UnrealFastNoise2\Binaries\ThirdParty\FastNoise2 and place libFastNoise.so and libFastNoiseD.so in it and let me know if it works.

@Ayliroe
Copy link
Author

Ayliroe commented May 29, 2023

So, I had tried a while ago a setup using the libFastNoise.so and libFastNoiseD.so provided as-is in the FastNoise2 repo, but got a bunch of "undefined symbol" errors I thought were due to mismatching FastNoise versions.

Just tried again with your changes, and I ran into two issues:

  • I had to edit FastNoise2.build.cs, as the IDE I use (JetBrains Rider) failed to load the project due to lines like private string ConfigName => Target.Configuration == UnrealTargetConfiguration.Debug ? "Debug" : "Release";. Could be because it's "IL code"? I'm not familiar with the standard.
  • I can compile for Windows with the new branch, but still get "undefined symbols" for Android. Seems to be due to the "SmartNodeManager" in SmartNode.h. I attached the log.
    log.log

@DoubleDeez
Copy link
Owner

The inline failing is interesting since I only did it that way cause Rider recommended it to me, I'm probably running a newer .net version or something. I'll switch it back for compatibility.

Did you compile those .so files for Android yourself? The plugin is expecting v.0.9.7-alpha, I haven't updated to 0.10.0 yet.

@Ayliroe
Copy link
Author

Ayliroe commented May 29, 2023

I haven't tried yet to make an actual android .so, I just copied the linux ones in FastNoise2-v0.9.7-alpha-Linux64-GCC to get the compilation to continue and see if other errors occured. Porting my project to android is actually just for fun, so it's not much of a priority right now unfortunately.

@Starkium
Copy link

Starkium commented Aug 7, 2024

Same issue, going to test suggestions

@Starkium
Copy link

Starkium commented Aug 7, 2024

haven't been able to compile the .so, the docs aren't super clear on how to do this. It only gives examples on how to do it for windows/linux/mac. I'm using CMake and attempting to point it to an android set up. For some reason after it finishes building, I cannot find the output or it just doesn't make .so.

@Starkium
Copy link

Starkium commented Aug 7, 2024

Oh right, Android (like Linux) probably uses .so/.a files.

I'm not setup to build Android but here's my thoughts:

You'll need to follow FastNoise2's docs to compile for Android.

In /Source/ThirdParty/FastNoise2 you'll need to add an Android folder with Release and Debug subfolders and add the files you compiled in the last step.

You'll also need to update the include files in /Source/ThirdParty/FastNoise2/include with the ones you used to build FastNoise2.

Then you'll need to modify /Source/ThirdParty/FastNoise2/FastNoise2.build.cs with a special case when (Target.Platform == UnrealTargetPlatform.Android) to add the .so files instead of .dll and .a instead of the .lib.

If you get this working, please make a PR so we can have it available for everyone.

I don't see any info for how to compile .so. How did you get that working?

@DoubleDeez
Copy link
Owner

I haven't built android at all, but I did update the plugin to support it (untested), it's just missing the libs

@Starkium
Copy link

I haven't built android at all, but I did update the plugin to support it (untested), it's just missing the libs

I noticed that, but I have no clue how to go about building the libs. Could you supply some .so's for android or write up how to do it properly? I'd really appreciate that.

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

3 participants