-
Notifications
You must be signed in to change notification settings - Fork 134
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
Android build doesn't work #197
Comments
Android is completely experimental, and you'll need to help and experiment to get it working. terrain.gdextension loads android in the current version. I haven't rebuild android since then. Try this: |
Thanks for the fast reply, I want to help as much as I can. Unfortunately adding those new lines, I get a
Like it did not compile, am I on the wrong version? I'm using latest terrain3d and godot 4.1.1 |
Does this file exist on your filesystem? |
No it doesn't. The path is wrong. Add '/bin' in front of the filename in terrain.gdextension. |
Those are clearly windows libraries. The android libraries are only in this experimental android build. Download this artifact and replace terrain.gdextension. https://github.com/TokisanGames/Terrain3D/actions/runs/6006189731 |
@Saul2022 I need console messages. Gui errors are not helpful. When the files exist and the path names are correct, does Godot load the android library? Is the plugin available in the project settings/plugins? Can it be enabled? |
New android build w/ fixed terrain.gdextension paths and other adjustments. https://github.com/TokisanGames/Terrain3D/actions/runs/6026697901 |
That is not the console. I want the text logs. Either from the console window or from the log files. I don't know where they are on android. Maybe? @luiscesjr what's your status? |
Upgrading leaves me with the same errors as @Saul2022, I was looking for your changes to see where could it be. The error is in the editor, before even exporting, so no logs for now.
I know a lot of the errors here lie in the fact that I can't enable the plugin because of some other errors. If that makes any sense. Maybe the dll from the latest windows binary does not match the changes from current branch? I also had a look at the #75388 issue from Godot, but the workarounds there did not help me. |
This has nothing to do with Godot issue #75388. Hmm, there's nothing before this? That's the absolute first line in the log/console? This says it is attempting to load the windows library, which will never work on an android. What type of device are you using?
I found an error in the registration files which I fixed. I'm changing the android lines to:
Please try this build, look at the logs and if it's still attempting to load the windows library, remove it and the non-android lines from terrain.gdextension. Also tell me your exact hardware device. If it fails, copy all logs here again. |
No, as I said, this happens in the Godot editor, even before exporting, these logs have nothing to do with the Android build because I can't even export. The steps here are Open the editor > on project load it throws all these errors. And it keeps spamming this: As I stated earlier, I thought it had to do with #75388 because it seems to not even load the scripts, which judging by these lines:
It seems to be the main culprit? Somehow the release dll is not working with these changes. The console log is still the same:
|
Now I understand. That android build has only the android libraries in it. You need both the windows and the android libraries in the bin folder on your computer so you can open it in windows, and it can export to android. Any of the recent Windows libraries can be placed in the bin directory. Here's the latest build. Keep the current android build with the terrain.gdextension file, and copy the windows dlls from this artifact. https://github.com/TokisanGames/Terrain3D/actions/runs/6003166159 Later the Build All job on github will make the full release package. That will come with all libraries for windows/linux/macos/android in one download. |
Here's a build with everything, win/lin/mac/android. This loads up in windows just fine and has all libraries. |
Your last artifact worked just fine, In fact I guess it was mostly my fault, sorry for this huge mess. I won't have much time today to run some tests, on the upgrade I accidentally deleted my test terrains, so I'll have to rebuild them and then test the mobile build. As soon as I'm able I hope to help more with the project, I'll mark this as closed since the addon is working, as per first post. Any further improvements/bug reports I'll open new issues / push requests. Thank you for your time and attention. |
It's working in Windows and Android? Great, you helped out a lot. Now we know we can build for and work on android and it can be a supported platform. When you're free let's work together on #137. Feel free to join my discord for faster progress. tokisan.com/discord. @Saul2022 Can you get my last link working on your android? |
Sure, sent you a request there to be added to the community. While it did boot the editor without errors, and compiled the android package with the provided bin, my scene is still not working. When I enter the server we continue to evaluate from there then! |
weirdly with the latest build , i get the same errors, of not declarong the scope in editor and cant work, my phone is an oppo reno 4z 5g. |
What are the console messages or logs from the android device? And does the demo work? I'm not concerned about your custom scenes into the demo is proven to work. We want a clean testing environment. |
the outpout says the same about the editor thing not declared in the current scope . it the demo, when running the project , not a custom scene. |
how you got it to work without the scope error luis? |
Is this an error on android or on your windows computer? terrain.gdextension has a flag for android, does it not? Doesn't it look like this? |
I think you are missing either the android .so in bin folder, or the dll, or the flags in the terrain.gdextension. Get them from here ; https://github.com/TokisanGames/Terrain3D/actions/runs/6003166159 And here: https://github.com/TokisanGames/Terrain3D/actions/runs/6030110189 I mean, the first post issue is gone, I can confirm now it finds the right .so in bin folder. An example of a working .gdextension is:
Sorry, I thought I still also had the issue of
But I had wrong params in the .gdextension file. Now the error I get when trying to open both the Demo and my own scenes, I did not figure out yet, I'm not sure I the debugger is not attached or it really is not printing to the console anything. |
Terrain3D/src/register_types.cpp Line 32 in 21d8547
|
Thanks, changed that line. But still no dice, the apk is installed and upon opening the demo for example, just a black screen and then it crashes. My debugger somehow was off, don't know why. I also I have no idea why, turning on both "Deploy with remote debug" and "Small Deploy with network filesystem", the demo boots. This is the screenshot: |
By the way changing it to this, gives back the errors from before, same as @Saul2022 . Maybe it really is terrain_library_init? |
Thank you. Strangely the screenshot mentions android.debug.arm64.dll, but these text logs do not. |
Not sure though while i tried experimenting with dll rename, though i didn't use it at the end for the screenshot and has the same errors as .so also maybe this could be happening because of this pr not being merged godotengine/godot#80740 maybe it could fix it. But that opens the question of how was he able to get it to work, unless he used his custom build. |
Ah good find. His PR says specifically, This Issue is on hold for now unless he comes in with a solution or we know that the upstream process is working for gdextensions. Specifically that PR is merged in, the android sample template, and documentation of a working process from C++ gdextension to android export is finished. He's got a lot of additional files in his sample project. It doesn't look like it's trivial to setup for android. I will exclude android builds from my point releases until then. |
godotengine/godot#80740 was merged into 4.2. No docs or 4.1 yet. |
@TokisanGames I'm trying to understand the thread; is the issue that Terrain3D doesn't work when exporting to Android, or that Terrain3D doesn't load in the Godot Android Editor? Do you have a build I can test?
The sample showcases how to build an Android AAR plugin with GDExtension capabilities, which is a plugin that needs to access and use APIs from Android platforms and libraries. There's a draft for documentation in godotengine/godot-docs#7884, hopefully that clarifies things a bit more. Otherwise let me know and I can clarify further. |
@m4gr3d This artifact has windows/Linux/macos/android libraries built by Github. The guys above exported with 4.1 to android and couldn't get it to load the libraries. Initially we had the paths wrong in terrain.gdextension. But that should be fixed now. Tbh, I don't know if they are trying to do an android game export or get the editor running on android. Is there a difference in the library? I don't have the environment setup or know anything about Godot on android. @luiscesjr @Saul2022 which are you doing? Let's say just first getting the demo to export to an android as a game. Can anyone do that with the above link? When you got it working, we're you using stock 4.1, or a version of your android rework pr? |
@Saul2022 which are you doing? Get the extension to work on godot editor android version . |
When I opened the thread, I had issues loading the Terrain3D library on my exported game, while playtesting in Android. This appears to have been, or is, an issue with Godot on Android. Then things shifted to not being able to load the extension in the editor? I have no idea really, that's why I've been in radio silence, waiting for things to settle down. Anyway, the latest 4.2 dev release (Should be .dev4 by now?) fixes the library loading issues on Android? If so I'll test out both my game and the demo. |
I tried to follow this thread, but I am new to Godot generally and Terrain3D. Using Godot 4.1.1.stable.official, either building Terrain3D (scons platform=android) directly or using the artifacts fails when I try to export my project to Android:
My C++ GDExtension does not error. Do I need Godot 4.2? I do see Android improvements, including the plugin API, but that is still on dev snapshots. |
@directedchaossoftware Android Gdextension is reportedly broken in 4.1 until the new rewrite. The only person who has been able to make Terrain3D work on Android is the one rewriting the engine code. 4.2 won't be out until November, and android support in Terrain3D is on hold until it is available, the process for supporting android in Gdextension is documented and easy enough to follow, and/or the rewriter helps us support Android. |
So I've tested the artifact from https://github.com/TokisanGames/Terrain3D/actions/runs/6038280432 by exporting an Android build to a Samsung Tab S8 using Godot Editor 4.2 beta 5 running from a Linux desktop and it works as expected (note that the visible rendering artifacts is a known issue tracked by #137). Screen_Recording_20231116_153742_Terrain3D.mp4So that specific issue should be resolved. |
Validated that it loads and run in the Godot Android Editor 4.2 beta 5, although that specific demo seems to have performance issues that causes the editor to crash after a bit.. it may be good to use for profiling and optimizing the Android editor! terrain_3d_demo_godot_android_editor.mp4 |
@TokisanGames Looks like the issues reported here are fixed in the recent Godot 4.2 build, so this issue can be closed. For Android compat, you may want to bump the |
Thanks for the update @m4gr3d.
|
Yes, that's correct; none of those are required. For context, you'd made use of the linked options if your gdextension logic needed to access Android / Java specific APIs and capabilities (e.g: doing permissions requests and checks on Android platforms). |
The 0.9 branch now builds android in the release package now, and has a fix for 4.2. Can anyone else build Terrain3D 0.9 or use this artifact and get it working on android using 4.2? |
. Can anyone else build Terrain3D 0.9 or use this artifact and get it working on android using 4.2? Yes with an oppo reno 4z 5g the artifact worked for me, great job , though the editor expectedly is bugged, but it a pretty good step. |
OK, we'll say it works for now in 4.2 as experimental. Thanks. |
Whenever I try loading a scene that has Terrain3D node on it, it just won't load, no errors thrown in the output nor the debugger, can't really say what's going on, appart from a build error when exporting to my test device:
I've added the missing flags on my feature export side, but that did not change anything.
But actually looking at the libraries list:
It's not really supposed to work on mobiles?
I've seen the #137 Issue, but that seemed to at least load?
The text was updated successfully, but these errors were encountered: