TokisanGames/Terrain3D

Android build doesn't work

Closed this issue · 52 comments

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:

 No suitable library found for GDExtension: res://addons/terrain_3d/terrain.gdextension. Possible feature flags for your platform: mobile, android, etc2, astc, arm64, arm64-v8a, template, debug, template_debug
  Cannot erase nonexistent section "params".

I've added the missing flags on my feature export side, but that did not change anything.

But actually looking at the libraries list:

macos.debug = "bin/libterrain.macos.debug.framework"
macos.release = "bin/libterrain.macos.release.framework"
windows.debug.x86_64 = "bin/libterrain.windows.debug.x86_64.dll"
windows.release.x86_64 = "bin/libterrain.windows.release.x86_64.dll"
linux.debug.x86_64 = "bin/libterrain.linux.debug.x86_64.so"
linux.release.x86_64 = "bin/libterrain.linux.release.x86_64.so"
linux.debug.arm64 = "bin/libterrain.linux.debug.arm64.so"
linux.release.arm64 = "bin/libterrain.linux.release.arm64.so"
linux.debug.rv64 = "bin/libterrain.linux.debug.rv64.so"
linux.release.rv64 = "bin/libterrain.linux.release.rv64.so"

It's not really supposed to work on mobiles?

I've seen the #137 Issue, but that seemed to at least load?

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:
https://github.com/TokisanGames/Terrain3D/blob/main/project/addons/terrain_3d/terrain.gdextension

Thanks for the fast reply, I want to help as much as I can.

Unfortunately adding those new lines, I get a

Can't open file from path 'res://addons/terrain_3d/libterrain.android.debug.arm64.so'.

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.

Oops I also did not notice that.

But still having the right path:

android.debug.arm64 = "bin/libterrain.android.debug.arm64.so"
android.release.arm64 = "bin/libterrain.android.release.arm64.so"

It throws the same error, I only have two binaries at the bin folder.

image

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

for me i get this errors and replaced terrain gdextension with the other file you provided
Screenshot_2023-08-30-16-45-49-17_653f2d6f0c14415f40b50121f34f510c

Screenshot_2023-08-30-16-44-58-44_653f2d6f0c14415f40b50121f34f510c

@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

The plugin appears in the plugins tab, but can't be enabled this is the errors console gives and happens when trying to activate the plugin , also the scene is the one of the project has.
Screenshot_2023-08-30-18-10-56-20_653f2d6f0c14415f40b50121f34f510c

Edit: on a new created project the errors happen too though it seem the particular error is at the editor thing

Screenshot_2023-08-30-18-17-36-11_653f2d6f0c14415f40b50121f34f510c

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?
https://ask.godotengine.org/130310/how-to-get-log-file-for-android?show=130310#q130310

@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.

image

The error is in the editor, before even exporting, so no logs for now.

 res://addons/terrain_3d/editor/editor.gd:11 - Parse Error: Could not find type "Terrain3D" in the current scope.
  res://addons/terrain_3d/editor/editor.gd:16 - Parse Error: Could not find type "Terrain3DEditor" in the current scope.
  res://addons/terrain_3d/editor/editor.gd:27 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:52 - Parse Error: Could not find type "Terrain3D" in the current scope.
  res://addons/terrain_3d/editor/editor.gd:59 - Parse Error: Could not find type "Terrain3D" in the current scope.
  res://addons/terrain_3d/editor/editor.gd:128 - Parse Error: Could not find type "Terrain3DEditor" in the current scope.
  res://addons/terrain_3d/editor/editor.gd:130 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:133 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:134 - Parse Error: Identifier "Terrain3DStorage" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:135 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:136 - Parse Error: Identifier "Terrain3DStorage" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:137 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:143 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:147 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:151 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:152 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:168 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:188 - Parse Error: Could not find type "Terrain3DSurface" in the current scope.
  res://addons/terrain_3d/editor/editor.gd:200 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:201 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
Could not find version of build tools that matches Target SDK, using 30.0.3 - **Android warning, ignore.**
  Can't resolve symbol terrain_3d_init, error: "Error 127: Não foi possível encontrar o procedimento especificado.".
  core/extension/gdextension.cpp:464 - GDExtension entry point 'terrain_3d_init' not found in library res/addons/terrain_3d/bin/libterrain.windows.debug.x86_64.dll
  Failed loading resource: res://addons/terrain_3d/terrain.gdextension. Make sure resources have been imported by opening the project in the editor at least once.
  res://addons/terrain_3d/editor/editor.gd:11 - Parse Error: Could not find type "Terrain3D" in the current scope.
  res://addons/terrain_3d/editor/editor.gd:16 - Parse Error: Could not find type "Terrain3DEditor" in the current scope.
  res://addons/terrain_3d/editor/editor.gd:27 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:52 - Parse Error: Could not find type "Terrain3D" in the current scope.
  res://addons/terrain_3d/editor/editor.gd:59 - Parse Error: Could not find type "Terrain3D" in the current scope.
  res://addons/terrain_3d/editor/editor.gd:128 - Parse Error: Could not find type "Terrain3DEditor" in the current scope.
  res://addons/terrain_3d/editor/editor.gd:130 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:133 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:134 - Parse Error: Identifier "Terrain3DStorage" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:135 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:136 - Parse Error: Identifier "Terrain3DStorage" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:137 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:143 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:147 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:151 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:152 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:168 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:188 - Parse Error: Could not find type "Terrain3DSurface" in the current scope.
  res://addons/terrain_3d/editor/editor.gd:200 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:201 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  Cannot get class 'Terrain3DSurface'.
  Cannot get class 'Terrain3DStorage'.
  Cannot get class 'Terrain3D'.
  Cannot get class 'Terrain3DSurface'.
  Cannot get class 'Terrain3DStorage'.
  Cannot get class 'Terrain3D'.

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?

Can't resolve symbol terrain_3d_init, error: "Error 127: Não foi possível encontrar o procedimento especificado.". core/extension/gdextension.cpp:464 - GDExtension entry point 'terrain_3d_init' not found in library res/addons/terrain_3d/bin/libterrain.windows.debug.x86_64.dll

I found an error in the registration files which I fixed. I'm changing the android lines to:

android.debug.arm64 = "res://addons/terrain_3d/bin/libterrain.android.debug.arm64.so"
android.release.arm64 = "res://addons/terrain_3d/bin/libterrain.android.release.arm64.so"

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.
https://github.com/TokisanGames/Terrain3D/actions/runs/6030110189

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:

image

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:

core/extension/gdextension.cpp:464 - GDExtension entry point 'terrain_3d_init' not found in library res/addons/terrain_3d/bin/libterrain.windows.debug.x86_64.dll
Failed loading resource: res://addons/terrain_3d/terrain.gdextension. Make sure resources have been imported by opening the project in the editor at least once.

It seems to be the main culprit? Somehow the release dll is not working with these changes.
To further back this, if I go back, download the release terrain3d_0.8.2-alpha_gd4.1.1_win64.zip, the errors are gone, and I
can use the Godot editor normally.

The console log is still the same:

Can't resolve symbol terrain_3d_init, error: "Error 127: Não foi possível encontrar o procedimento especificado.".
  core/extension/gdextension.cpp:464 - GDExtension entry point 'terrain_3d_init' not found in library res/addons/terrain_3d/bin/libterrain.windows.debug.x86_64.dll
  Failed loading resource: res://addons/terrain_3d/terrain.gdextension. Make sure resources have been imported by opening the project in the editor at least once.
  res://addons/terrain_3d/editor/components/surface_list.gd:130 - Parse Error: Could not find type "Terrain3DSurface" in the current scope.
  res://addons/terrain_3d/editor/components/surface_list.gd:131 - Parse Error: Could not find type "Terrain3DSurface" in the current scope.
  res://addons/terrain_3d/editor/components/surface_list.gd:133 - Parse Error: Could not find type "Terrain3DSurface" in the current scope.
  res://addons/terrain_3d/editor/components/surface_list.gd:254 - Parse Error: Could not find type "Terrain3DSurface" in the current scope.
  res://addons/terrain_3d/editor/components/surface_list.gd:222 - Parse Error: Identifier "Terrain3DSurface" not declared in the current scope.
  res://addons/terrain_3d/editor/components/surface_list.gd:246 - Parse Error: Could not find type "Terrain3DSurface" in the current scope.
  res://addons/terrain_3d/editor/components/surface_list.gd:249 - Parse Error: Could not find type "Terrain3DSurface" in the current scope.
  res://addons/terrain_3d/editor/components/surface_list.gd:249 - Parse Error: Identifier "Terrain3DSurface" not declared in the current scope.
  res://addons/terrain_3d/editor/components/toolbar.gd:4 - Parse Error: Could not find type "Terrain3DEditor" in the current scope.
  res://addons/terrain_3d/editor/components/toolbar.gd:4 - Parse Error: Could not find type "Terrain3DEditor" in the current scope.
  res://addons/terrain_3d/editor/components/toolbar.gd:49 - Parse Error: Could not find type "Terrain3DEditor" in the current scope.
  res://addons/terrain_3d/editor/components/toolbar.gd:49 - Parse Error: Could not find type "Terrain3DEditor" in the current scope.
  res://addons/terrain_3d/editor/components/toolbar.gd:29 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/toolbar.gd:29 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/toolbar.gd:30 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/toolbar.gd:30 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/toolbar.gd:32 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/toolbar.gd:32 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/toolbar.gd:33 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/toolbar.gd:33 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/toolbar.gd:34 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/toolbar.gd:34 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/toolbar.gd:35 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/toolbar.gd:35 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/toolbar.gd:36 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/toolbar.gd:36 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/toolbar.gd:37 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/toolbar.gd:37 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/toolbar.gd:39 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/toolbar.gd:39 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/toolbar.gd:40 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/toolbar.gd:40 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/toolbar.gd:42 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/toolbar.gd:42 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/toolbar.gd:43 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/toolbar.gd:43 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/tool_settings.gd:171 - Parse Error: Could not find type "Terrain3DEditor" in the current scope.
  res://addons/terrain_3d/editor/components/tool_settings.gd:175 - Parse Error: Could not find type "Terrain3DEditor" in the current scope.
  res://addons/terrain_3d/editor/components/tool_settings.gd:41 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/tool_settings.gd:44 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/tool_settings.gd:49 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/tool_settings.gd:177 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/tool_settings.gd:179 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/tool_settings.gd:181 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/ui.gd:28 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/ui.gd:78 - Parse Error: Could not find type "Terrain3DEditor" in the current scope.
  res://addons/terrain_3d/editor/components/ui.gd:78 - Parse Error: Could not find type "Terrain3DEditor" in the current scope.
  res://addons/terrain_3d/editor/components/ui.gd:73 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/ui.gd:86 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/ui.gd:91 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/ui.gd:97 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/ui.gd:101 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/ui.gd:110 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/ui.gd:117 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/ui.gd:126 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/ui.gd:160 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/ui.gd:178 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/ui.gd:182 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/ui.gd:184 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/ui.gd:186 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/ui.gd:191 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/ui.gd:193 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/ui.gd:195 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/ui.gd:197 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/ui.gd:199 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/ui.gd:201 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/ui.gd:203 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/ui.gd:207 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/ui.gd:209 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/ui.gd:211 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/ui.gd:215 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/components/ui.gd:217 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:11 - Parse Error: Could not find type "Terrain3D" in the current scope.
  res://addons/terrain_3d/editor/editor.gd:16 - Parse Error: Could not find type "Terrain3DEditor" in the current scope.
  res://addons/terrain_3d/editor/editor.gd:27 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:52 - Parse Error: Could not find type "Terrain3D" in the current scope.
  res://addons/terrain_3d/editor/editor.gd:59 - Parse Error: Could not find type "Terrain3D" in the current scope.
  res://addons/terrain_3d/editor/editor.gd:128 - Parse Error: Could not find type "Terrain3DEditor" in the current scope.
  res://addons/terrain_3d/editor/editor.gd:130 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:133 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:134 - Parse Error: Identifier "Terrain3DStorage" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:135 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:136 - Parse Error: Identifier "Terrain3DStorage" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:137 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:143 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:147 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:151 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:152 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:168 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:188 - Parse Error: Could not find type "Terrain3DSurface" in the current scope.
  res://addons/terrain_3d/editor/editor.gd:200 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:201 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/tools/importer.gd:2 - Parse Error: Could not find base class "Terrain3D".

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.
https://github.com/TokisanGames/Terrain3D/suites/15685266711/artifacts/895421134

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!

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?

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?
https://docs.godotengine.org/en/stable/tutorials/scripting/gdextension/gdextension_cpp_example.html#using-the-gdextension-module

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:

[configuration]

entry_symbol = "terrain_library_init"
compatibility_minimum = 4.1

[libraries]

macos.debug = "bin/libterrain.macos.debug.framework"
macos.release = "bin/libterrain.macos.release.framework"
windows.debug.x86_64 = "bin/libterrain.windows.debug.x86_64.dll"
windows.release.x86_64 = "bin/libterrain.windows.release.x86_64.dll"
linux.debug.x86_64 = "bin/libterrain.linux.debug.x86_64.so"
linux.release.x86_64 = "bin/libterrain.linux.release.x86_64.so"
linux.debug.arm64 = "bin/libterrain.linux.debug.arm64.so"
linux.release.arm64 = "bin/libterrain.linux.release.arm64.so"
linux.debug.rv64 = "bin/libterrain.linux.debug.rv64.so"
linux.release.rv64 = "bin/libterrain.linux.release.rv64.so"

android.debug.arm64 = "res://addons/terrain_3d/bin/libterrain.android.debug.arm64.so"
android.release.arm64 = "res://addons/terrain_3d/bin/libterrain.android.release.arm64.so"

Sorry, I thought I still also had the issue of

 No suitable library found for GDExtension: res://addons/terrain_3d/terrain.gdextension. Possible feature flags for your platform: mobile, android, etc2, astc, arm64, arm64-v8a, template, debug, template_debug
  Cannot erase nonexistent section "params".

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.

terrain_library_init should be terrain_3d_init, matching

GDExtensionBool GDE_EXPORT terrain_3d_init(

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:

image

terrain_3d_init

By the way changing it to this, gives back the errors from before, same as @Saul2022 .

Maybe it really is terrain_library_init?

To clarify here, the situation with android debugging and godot:

  • In general, turning on Small Deploy with network filesystem, freezes most devices. It also freezes my game.
  • Somehow, the demo only opens it's scene, with this option on.
  • Now, getting my game to open without that option and trying to open the scene with Terrain3D prints the code down bellow.
  • I must try next to open the demo with the bugged option and see what the logcat outputs.

Ok, I finally got my debugger to work, it's like a million lines coming together, but I found the error on the adb log:

This is in my own scene, I'll check out the demo next.

08-31 17:52:47.347 16051 16149 E godot   : USER ERROR: Cannot get class 'Terrain3DSurface'.
08-31 17:52:47.347 16051 16149 E godot   :    at: instantiate (core/object/class_db.cpp:339)
08-31 17:52:47.347 16051 16149 E godot   : USER ERROR: res://Cenas/Testes/test_fake_mode_7.tscn:Resource of unrecognized type in file: Terrain3DSurface.
08-31 17:52:47.347 16051 16149 E godot   :    at: load (core/io/resource_format_binary.cpp:761)
08-31 17:52:47.356  1027 26579 W ExynosCamera: [CAM(1)][Front_0]-(m_previewStreamNFDPipeThreadFunc[6924]):wait timeout
08-31 17:52:47.359  3107 26528 I CameraLightSensor_Service: open preview end
08-31 17:52:47.359  3107 26528 I CameraLightSensor_Service: wrong aEState value =1
08-31 17:52:47.368 16051 16149 E godot   : USER ERROR: Failed loading resource: res://.godot/exported/133200997/export-b103c524b034723443f1251e005296a2-test_fake_mode_7.scn. Make sure resources have been imported by opening the project in the editor at least once.
08-31 17:52:47.368 16051 16149 E godot   :    at: _load (core/io/resource_loader.cpp:274)

And here is the demo:

08-31 17:59:46.582  7997  8148 E godot   : USER ERROR: No loader found for resource: res://demo/data/terrain_storage.res.
08-31 17:59:46.582  7997  8148 E godot   :    at: _load (core/io/resource_loader.cpp:281)
08-31 17:59:46.582  7997  8148 E godot   : USER ERROR: Can't load dependency: res://demo/data/terrain_storage.res.
08-31 17:59:46.582  7997  8148 E godot   :    at: parse_variant (core/io/resource_format_binary.cpp:458)
08-31 17:59:46.582  7997  8148 E godot   : USER ERROR: Error when trying to parse Variant.
08-31 17:59:46.582  7997  8148 E godot   :    at: parse_variant (core/io/resource_format_binary.cpp:502)
08-31 17:59:46.582  7997  8148 E godot   : USER ERROR: Error when trying to parse Variant.
08-31 17:59:46.582  7997  8148 E godot   :    at: parse_variant (core/io/resource_format_binary.cpp:489)
08-31 17:59:46.587  7997  8148 E godot   : USER ERROR: Failed loading resource: res://.godot/exported/133200997/export-f80a9e29aeb04aea4136453e2398f126-Demo.scn. Make sure resources have been imported by opening the project in the editor at least once.
08-31 17:59:46.587  7997  8148 E godot   :    at: _load (core/io/resource_loader.cpp:274)
08-31 17:59:46.587  7997  8148 E godot   : USER ERROR: Failed loading scene: res://demo/Demo.tscn
08-31 17:59:46.587  7997  8148 E godot   :    at: start (main/main.cpp:3219)
08-31 17:59:46.588  7997  8148 E godot   : USER ERROR: Condition "default_certs != nullptr" is true.
08-31 17:59:46.588  7997  8148 E godot   :    at: load_default_certificates (modules/mbedtls/crypto_mbedtls.cpp:342)
08-31 17:59:46.590  8345  8345 I [StandardPlus_1.0.6]_D2dProtocol: initialize - is MHS supported : true
08-31 17:59:46.591  1387  1762 D SemWifiApServiceImpl: supportWifiSharingLite() false
08-31 17:59:46.591  8345  8345 I [StandardPlus_1.0.6]_D2dProtocol: initialize - is WifiSharingLite supported : false
08-31 17:59:46.592  8345  8345 I [StandardPlus_1.0.6]_D2dProtocol: initialize - is RSDB supported : true
08-31 17:59:46.599   486   486 I lmkd    : 1(delay), 0(swap), 0(freelimit), 0(reentrymode) memory pressure events were skipped after a kill!
08-31 17:59:46.599   486   486 I lmkd    : cached 0, sandbox(not0) 0
08-31 17:59:46.600   486   486 I lmkd    : Reclaim 'com.samsung.android.game.gamehome:notification' (8372), uid 10085, oom_score_adj 250, state 5 to free 80724kB rss, 33860kB swap; reason: min2x watermark is breached even after kill
08-31 17:59:46.618  7997  8148 E godot   : USER ERROR: No loader found for resource: res://demo/data/terrain_storage.res.
08-31 17:59:46.618  7997  8148 E godot   :    at: _load (core/io/resource_loader.cpp:281)
08-31 17:59:46.619   549   549 W keymaster_tee: [WRN]begin req PARAMS: A1 P4
08-31 17:59:46.619  7997  8148 E godot   : USER ERROR: Can't load dependency: res://demo/data/terrain_storage.res.
08-31 17:59:46.619  7997  8148 E godot   :    at: parse_variant (core/io/resource_format_binary.cpp:458)
08-31 17:59:46.619  7997  8148 E godot   : USER ERROR: Error when trying to parse Variant.
08-31 17:59:46.619  7997  8148 E godot   :    at: parse_variant (core/io/resource_format_binary.cpp:502)
08-31 17:59:46.619  7997  8148 E godot   : USER ERROR: Error when trying to parse Variant.
08-31 17:59:46.619  7997  8148 E godot   :    at: parse_variant (core/io/resource_format_binary.cpp:489)
08-31 17:59:46.622  7997  8148 E godot   : USER ERROR: Failed loading resource: res://.godot/exported/133200997/export-f80a9e29aeb04aea4136453e2398f126-Demo.scn. Make sure resources have been imported by opening the project in the editor at least once.
08-31 17:59:46.622  7997  8148 E godot   :    at: _load (core/io/resource_loader.cpp:274)
08-31 17:59:46.622  7997  8148 E godot   : USER ERROR: Failed loading scene: res://demo/Demo.tscn
08-31 17:59:46.622  7997  8148 E godot   :    at: start (main/main.cpp:3219)
08-31 17:59:46.623   486   486 I lmkd    : 1(delay), 0(swap), 0(freelimit), 0(reentrymode) memory pressure events were skipped after a kill!
08-31 17:59:46.623  7997  8148 E godot   : USER ERROR: Condition "default_certs != nullptr" is true.
08-31 17:59:46.623  7997  8148 E godot   :    at: load_default_certificates (modules/mbedtls/crypto_mbedtls.cpp:342)
08-31 17:59:46.625   988   988 I Zygote  : Process 4634 exited due to signal 9 (Killed)
08-31 17:59:46.626   988   988 I Zygote  : Process 8372 exited due to signal 9 (Killed)
08-31 17:59:46.626   988   988 I Zygote  : Process 8337 exited due to signal 9 (Killed)
08-31 17:59:46.626  1260  8317 I ResourceManagerService: ResourceManagerService::Client::DeathNotifier::binderDied called
08-31 17:59:46.626  1260  8317 E mediaserver: unlinkToDeath: removed reference to death recipient but unlink failed.

terrain_3d_init
By the way changing it to this, gives back the errors from before, same as @Saul2022 .
Maybe it really is terrain_library_init?

$ strings libterrain.windows.debug.x86_64.dll |egrep terrain_library_init
$ strings libterrain.windows.debug.x86_64.dll |egrep terrain_3d_init
terrain_3d_init

I'm not sure which error messages were received. This function was renamed recently. terrain_3d_init is the latest. I imagine it wouldn't work if it were wrong.

There are a lot of steps from C++ code, compiler, linker, Godot loading libraries, export, apk packaging, transfer to android, install and run where something could go wrong.

Inside the godot-cpp folder is a test folder with a basic example project. The next step is to build that and export it to android to make sure your whole setup is working, independent of your game and Terrain3D. See here. If that doesn't work, nothing we do in Terrain3D will work. Once that is working then we can expect terrain3d to work. Once that is working, then your game has a hope of running.

Is this an error on android or on your windows computer?

Android, terrain works on windows.

Is this an error on android or on your windows computer?

Android, i don't export, just testing the demo files on the android build

terrain.gdextension has a flag for android, does it not?

Ir does
Screenshot_2023-09-01-08-25-55-78_754cf9a4094c34a8eeb04648e2e3eb8d

Doesn't it look like this?
Yes it has the libraries.

The dll file name of android is .so no ?

Also even with the bing and terrain.gdextension it throws me an error now about cannot load dynamic library because of dloper error?
Screenshot_2023-09-01-08-45-04-97_653f2d6f0c14415f40b50121f34f510c

That is dlopen, it's just a dynamic library open attempt. The problem is it's trying to open android.debug.arm64.dll. But we told it to open android.debug.arm64.so. Are there settings in your android export that can change that?

@Saul2022 you see all those red errors in your output window? There are 43 of them. I need all of them. You've given me half of 2. Expand that window, copy all of the text and extract it out.

I'm not convinced this is a terrain 3d problem. We need to test the Godot-cpp test project like I mentioned. Once that is successfully exported to android then we know that system is setup properly for the whole process. Right now we have no idea if the problem is In terrain3d code, godot-cpp code, terrain3d.gdextension, the android build & packaging scripts, Godot Android export settings, your Android tools, or Godot's android export bundling code.

So next step is build and export godot-cpp/test. Or get more experience.

@m4gr3d Can you help? What is missing in the process to export for Android? I currently have github building for android, but these two guys can't export to their devices.

Latest build w/ windows/Linux/macos/android
https://github.com/TokisanGames/Terrain3D/actions/runs/6038280432

That is dlopen, it's just a dynamic library open attempt. The problem is it's trying to open android.debug.arm64.dll. But we told it to open android.debug.arm64.so. Are there settings in your android export that can change that?

@Saul2022 you see all those red errors in your output window? There are 43 of them. I need all of them. You've given me half of 2. Expand that window, copy all of the text and extract it out.
Godot Engine v4.1.1.stable.official (c) 2007-present Juan Linietsky, Ariel Manzur & Godot Contributors.
--

Godot Engine v4.1.1.stable.official (c) 2007-present Juan Linietsky, Ariel Manzur & Godot Contributors.
--- Debug adapter server started ---
--- GDScript language server started ---
Selected screen scale:  1.79999995231628
  Can't open dynamic library: /storage/emulated/0/Documents/pleaseworl/addons/terrain_3d/bin/libterrain.android.debug.arm64.so. Error: dlopen failed: library "/storage/emulated/0/Documents/pleaseworl/addons/terrain_3d/bin/libterrain.android.debug.arm64.so" needed or dlopened by "/data/app/~~95LK3HU6zaYXRh3Vk-A34w==/org.godotengine.editor.v4-DKzBcH9VCEcNCivQoG9_og==/split_config.arm64_v8a.apk!/lib/arm64-v8a/libgodot_android.so" is not accessible for the namespace "classloader-namespace".
  core/extension/gdextension.cpp:455 - GDExtension dynamic library not found: /storage/emulated/0/Documents/pleaseworl/addons/terrain_3d/bin/libterrain.android.debug.arm64.so
  Failed loading resource: res://addons/terrain_3d/terrain.gdextension. Make sure resources have been imported by opening the project in the editor at least once.
  res://addons/terrain_3d/editor/editor.gd:11 - Parse Error: Could not find type "Terrain3D" in the current scope.
  res://addons/terrain_3d/editor/editor.gd:16 - Parse Error: Could not find type "Terrain3DEditor" in the current scope.
  res://addons/terrain_3d/editor/editor.gd:27 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:52 - Parse Error: Could not find type "Terrain3D" in the current scope.
  res://addons/terrain_3d/editor/editor.gd:59 - Parse Error: Could not find type "Terrain3D" in the current scope.
  res://addons/terrain_3d/editor/editor.gd:128 - Parse Error: Could not find type "Terrain3DEditor" in the current scope.
  res://addons/terrain_3d/editor/editor.gd:130 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:133 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:134 - Parse Error: Identifier "Terrain3DStorage" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:135 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:136 - Parse Error: Identifier "Terrain3DStorage" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:137 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:143 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:147 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:151 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:152 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:168 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:188 - Parse Error: Could not find type "Terrain3DSurface" in the current scope.
  res://addons/terrain_3d/editor/editor.gd:200 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:201 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:11 - Parse Error: Could not find type "Terrain3D" in the current scope.
  res://addons/terrain_3d/editor/editor.gd:16 - Parse Error: Could not find type "Terrain3DEditor" in the current scope.
  res://addons/terrain_3d/editor/editor.gd:27 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:52 - Parse Error: Could not find type "Terrain3D" in the current scope.
  res://addons/terrain_3d/editor/editor.gd:59 - Parse Error: Could not find type "Terrain3D" in the current scope.
  res://addons/terrain_3d/editor/editor.gd:128 - Parse Error: Could not find type "Terrain3DEditor" in the current scope.
  res://addons/terrain_3d/editor/editor.gd:130 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:133 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:134 - Parse Error: Identifier "Terrain3DStorage" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:135 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:136 - Parse Error: Identifier "Terrain3DStorage" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:137 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:143 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:147 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:151 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:152 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:168 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:188 - Parse Error: Could not find type "Terrain3DSurface" in the current scope.
  res://addons/terrain_3d/editor/editor.gd:200 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:201 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.

And then the errors of the build you sent now, can't test godot.cpp on android .

/ Godot Engine v4.1.1.stable.official (c) 2007-present Juan Linietsky, Ariel Manzur & Godot Contributors.
--- Debug adapter server started ---
--- GDScript language server started ---
  res://addons/terrain_3d/editor/editor.gd:11 - Parse Error: Could not find type "Terrain3D" in the current scope.
  res://addons/terrain_3d/editor/editor.gd:16 - Parse Error: Could not find type "Terrain3DEditor" in the current scope.
  res://addons/terrain_3d/editor/editor.gd:27 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:52 - Parse Error: Could not find type "Terrain3D" in the current scope.
  res://addons/terrain_3d/editor/editor.gd:59 - Parse Error: Could not find type "Terrain3D" in the current scope.
  res://addons/terrain_3d/editor/editor.gd:128 - Parse Error: Could not find type "Terrain3DEditor" in the current scope.
  res://addons/terrain_3d/editor/editor.gd:130 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:133 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:134 - Parse Error: Identifier "Terrain3DStorage" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:135 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:136 - Parse Error: Identifier "Terrain3DStorage" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:137 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:143 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:147 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:151 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:152 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:168 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:188 - Parse Error: Could not find type "Terrain3DSurface" in the current scope.
  res://addons/terrain_3d/editor/editor.gd:200 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
  res://addons/terrain_3d/editor/editor.gd:201 - Parse Error: Identifier "Terrain3DEditor" not declared in the current scope.
Selected screen scale:  1.79999995231628
  Can't open dynamic library: /storage/emulated/0/Download/Terrain3D/addons/terrain_3d/bin/libterrain.android.debug.arm64.so. Error: dlopen failed: library "/storage/emulated/0/Download/Terrain3D/addons/terrain_3d/bin/libterrain.android.debug.arm64.so" needed or dlopened by "/data/app/~~95LK3HU6zaYXRh3Vk-A34w==/org.godotengine.editor.v4-DKzBcH9VCEcNCivQoG9_og==/split_config.arm64_v8a.apk!/lib/arm64-v8a/libgodot_android.so" is not accessible for the namespace "classloader-namespace".
  core/extension/gdextension.cpp:455 - GDExtension dynamic library not found: /storage/emulated/0/Download/Terrain3D/addons/terrain_3d/bin/libterrain.android.debug.arm64.so
  Failed loading resource: res://addons/terrain_3d/terrain.gdextension. Make sure resources have been imported by opening the project in the editor at least once.
  No loader found for resource: res://demo/data/terrain_storage.res.
  Cannot get class 'Terrain3D'.
  scene/resources/mesh.cpp:354 - Condition "index >= vc" is true. Returning: Ref<TriangleMesh>()
  scene/resources/mesh.cpp:354 - Condition "index >= vc" is true. Returning: Ref<TriangleMesh>()
  scene/resources/mesh.cpp:354 - Condition "index >= vc" is true. Returning: Ref<TriangleMesh>()
  scene/resources/mesh.cpp:354 - Condition "index >= vc" is true. Returning: Ref<TriangleMesh>()
  scene/resources/mesh.cpp:354 - Condition "index >= vc" is true. Returning: Ref<TriangleMesh>()
  scene/resources/mesh.cpp:354 - Condition "index >= vc" is true. Returning: Ref<TriangleMesh>()
  scene/resources/mesh.cpp:354 - Condition "index >= vc" is true. Returning: Ref<TriangleMesh>()
  scene/resources/mesh.cpp:354 - Condition "index >= vc" is true. Returning: Ref<TriangleMesh>()
  scene/resources/mesh.cpp:354 - Condition "index >= vc" is true. Returning: Ref<TriangleMesh>()
  scene/resources/mesh.cpp:354 - Condition "index >= vc" is true. Returning: Ref<TriangleMesh>()
  scene/resources/mesh.cpp:354 - Condition "index >= vc" is true. Returning: Ref<TriangleMesh>()
  scene/resources/mesh.cpp:354 - Condition "index >= vc" is true. Returning: Ref<TriangleMesh>()
  scene/resources/mesh.cpp:354 - Condition "index >= vc" is true. Returning: Ref<TriangleMesh>()
  scene/resources/mesh.cpp:354 - Condition "index >= vc" is true. Returning: Ref<TriangleMesh>()
  scene/resources/mesh.cpp:354 - Condition "index >= vc" is true. Returning: Ref<TriangleMesh>()
  scene/resources/mesh.cpp:354 - Condition "index >= vc" is true. Returning: Ref<TriangleMesh>()
  scene/resources/mesh.cpp:354 - Condition "index >= vc" is true. Returning: Ref<TriangleMesh>()
  scene/resources/mesh.cpp:354 - Condition "index >= vc" is true. Returning: Ref<TriangleMesh>()
  scene/resources/mesh.cpp:354 - Condition "index >= vc" is true. Returning: Ref<TriangleMesh>()

Thank you. Strangely the screenshot mentions android.debug.arm64.dll, but these text logs do not.

Thank you. Strangely the screenshot mentions

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.

Screenshot_2023-09-01-11-25-25-79_40deb401b9ffe8e1df2f1cc5ba480b12

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 refactor focuses on cleaning up and restoring full functionality for Godot Android plugins, which have effectively been (partially) broken since the Godot 4.0 release.

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.

m4gr3d commented

@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?

He's got a lot of additional files in his m4gr3d/Godot-Android-Samples#2. It doesn't look like it's trivial to setup for android.

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.
If you don't have a need for Android platforms and libraries APIs, then building a GDExtension plugin with Android support like you have been doing is the way to go.

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.
https://github.com/TokisanGames/Terrain3D/actions/runs/6038280432

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:

No suitable library found for GDExtension: res://addons/terrain_3d/terrain.gdextension. Possible feature flags for your platform: mobile, android, etc2, astc, arm32, armeabi-v7a, arm64, arm64-v8a, template, debug, template_debug

platform/android/export/export_plugin.cpp:744 - Cannot determine architecture for library "res://bin/libgdmin.android.template_debug.arm64.so". One of the supported architectures must be used as a tag: arm32 arm64 x86_32 x86_64

editor/export/editor_export_platform.h:178 - Export: Could not export project files.

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.

@m4gr3d This artifact has windows/Linux/macos/android libraries built by Github. https://github.com/TokisanGames/Terrain3D/actions/runs/6038280432

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?

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.mp4

So that specific issue should be resolved.
Next I'll validate loading and running the same artifact in the Godot Android Editor.

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 compatibility_minimum to 4.2 to ensure proper support.

Thanks for the update @m4gr3d.

  • So just by using Godot 4.2, our current android build works? Meaning, we don't need any of this or this or this in our project? If so I will close this and combine the android build in with the main build as an experimental option.

  • AFAIK, compatibility_minimum is for the whole plugin, not per platform. So I'll keep it at 4.1, but will document that android needs 4.2.

  • Based on what I learned about ios and android, I'm actually surprised the demo works for you at all using DDS textures. My understanding and this is that DDS on android is virtually unsupported and needs ASTC/ETC2. Yet the textures in the demo are only DDS and since Godot doesn't import them, they are not converted to ETC2, as PNG might be. So, in this sample project are you using the included DDS textures? How is it that they are working?

Thanks for the update @m4gr3d.

  • So just by using Godot 4.2, our current android build works? Meaning, we don't need any of this or this or this in our project? If so I will close this and combine the android build in with the main build as an experimental option.

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.

Screenshot_2023-11-18-10-27-33-67_653f2d6f0c14415f40b50121f34f510c

OK, we'll say it works for now in 4.2 as experimental. Thanks.