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

Android build doesn't work #197

Closed
luiscesjr opened this issue Aug 30, 2023 · 52 comments
Closed

Android build doesn't work #197

luiscesjr opened this issue Aug 30, 2023 · 52 comments
Labels
building Related to compiling or packaging waiting for godot Bug or missing feature in the engine
Milestone

Comments

@luiscesjr
Copy link

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?

@TokisanGames
Copy link
Owner

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

@luiscesjr
Copy link
Author

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

@TokisanGames
Copy link
Owner

Does this file exist on your filesystem?

@TokisanGames
Copy link
Owner

No it doesn't. The path is wrong. Add '/bin' in front of the filename in terrain.gdextension.

@luiscesjr
Copy link
Author

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

@TokisanGames
Copy link
Owner

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

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

@TokisanGames
Copy link
Owner

TokisanGames commented Aug 30, 2023

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

@TokisanGames
Copy link
Owner

New android build w/ fixed terrain.gdextension paths and other adjustments.

https://github.com/TokisanGames/Terrain3D/actions/runs/6026697901

@Saul2022
Copy link

Saul2022 commented Aug 30, 2023

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

@TokisanGames
Copy link
Owner

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?

@luiscesjr
Copy link
Author

luiscesjr commented Aug 30, 2023

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.

@TokisanGames
Copy link
Owner

TokisanGames commented Aug 30, 2023

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

@luiscesjr
Copy link
Author

luiscesjr commented Aug 31, 2023

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

@TokisanGames
Copy link
Owner

TokisanGames commented Aug 31, 2023

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.

@TokisanGames
Copy link
Owner

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

@luiscesjr
Copy link
Author

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.

@TokisanGames
Copy link
Owner

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?

@luiscesjr
Copy link
Author

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!

@Saul2022
Copy link

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.

@TokisanGames
Copy link
Owner

TokisanGames commented Aug 31, 2023

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.

@TokisanGames TokisanGames reopened this Aug 31, 2023
@Saul2022
Copy link

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.

@Saul2022
Copy link

how you got it to work without the scope error luis?

@TokisanGames
Copy link
Owner

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

@luiscesjr
Copy link
Author

luiscesjr commented Aug 31, 2023

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.

@TokisanGames
Copy link
Owner

TokisanGames commented Aug 31, 2023

terrain_library_init should be terrain_3d_init, matching

GDExtensionBool GDE_EXPORT terrain_3d_init(

@luiscesjr
Copy link
Author

luiscesjr commented Aug 31, 2023

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

@luiscesjr
Copy link
Author

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?

@TokisanGames
Copy link
Owner

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

@Saul2022
Copy link

Saul2022 commented Sep 1, 2023

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.

@TokisanGames TokisanGames added the waiting for godot Bug or missing feature in the engine label Sep 1, 2023
@TokisanGames TokisanGames added this to the Stable milestone Sep 1, 2023
@TokisanGames TokisanGames moved this to Stable Release in Terrain3D Roadmap Sep 1, 2023
@TokisanGames
Copy link
Owner

TokisanGames commented Sep 1, 2023

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.

@TokisanGames TokisanGames changed the title Scenes with Terrain3D won't load in Android Build Android build doesn't work Sep 4, 2023
@TokisanGames
Copy link
Owner

godotengine/godot#80740 was merged into 4.2. No docs or 4.1 yet.

@m4gr3d
Copy link

m4gr3d commented Sep 6, 2023

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

@TokisanGames
Copy link
Owner

TokisanGames commented Sep 6, 2023

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

Saul2022 commented Sep 7, 2023

@Saul2022 which are you doing?

Get the extension to work on godot editor android version .

@luiscesjr
Copy link
Author

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.

@directedchaossoftware
Copy link
Contributor

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.

@TokisanGames
Copy link
Owner

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

@TokisanGames TokisanGames added the building Related to compiling or packaging label Oct 2, 2023
@m4gr3d
Copy link

m4gr3d commented Nov 16, 2023

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

@m4gr3d
Copy link

m4gr3d commented Nov 16, 2023

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

@m4gr3d
Copy link

m4gr3d commented Nov 16, 2023

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

@TokisanGames
Copy link
Owner

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?

@m4gr3d
Copy link

m4gr3d commented Nov 17, 2023

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

@TokisanGames
Copy link
Owner

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?

@Saul2022
Copy link

. 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

@TokisanGames
Copy link
Owner

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

@github-project-automation github-project-automation bot moved this from Stable Release to Done in Terrain3D Roadmap Nov 18, 2023
@TokisanGames TokisanGames modified the milestones: Stable, Beta Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
building Related to compiling or packaging waiting for godot Bug or missing feature in the engine
Projects
Status: Done
Development

No branches or pull requests

5 participants