I’m stuck with compiling Defold on Windows for Android.
So I successfully downloaded and installed the Android SDK/NDK and am trying to compile Defold:
./scripts/build.py shell
./scripts/build.py build_engine --platform=arm64-android --skip-tests -- --skip-build-tests
The JAVA_HOME environment variable is set to JDK11 path.
If JDK8 path goes first in the PATH environment variable, I get the following error:
BUILD FAILED
C:\Sources\Arenum\defold_141\com.dynamo.cr\com.dynamo.cr.bob\build.xml:165: Compile failed; see the compiler error output for details.
Total time: 19 seconds
Buildfile: C:\Sources\Arenum\defold_141\com.dynamo.cr\com.dynamo.cr.bob\build.xml
clean:
[delete] Deleting directory C:\Sources\Arenum\defold_141\com.dynamo.cr\com.dynamo.cr.bob\build
[delete] Deleting directory C:\Sources\Arenum\defold_141\com.dynamo.cr\com.dynamo.cr.bob\generated
[delete] Deleting directory C:\Sources\Arenum\defold_141\com.dynamo.cr\com.dynamo.cr.bob\dist
[delete] Deleting directory C:\Sources\Arenum\defold_141\com.dynamo.cr\com.dynamo.cr.bob\tmp
[delete] Deleting: C:\Sources\Arenum\defold_141\com.dynamo.cr\com.dynamo.cr.bob\lib\luajit-share.zip
git.revision:
compile-bob-light:
[mkdir] Created dir: C:\Sources\Arenum\defold_141\com.dynamo.cr\com.dynamo.cr.bob\build
[mkdir] Created dir: C:\Sources\Arenum\defold_141\com.dynamo.cr\com.dynamo.cr.bob\generated
[exec] gamesys/atlas_ddf.proto:5:1: warning: Import ddf/ddf_math.proto is unused.
[exec] gamesys/buffer_ddf.proto:5:1: warning: Import ddf/ddf_math.proto is unused.
[exec] gamesys/buffer_ddf.proto:4:1: warning: Import ddf/ddf_extensions.proto is unused.
[exec] gamesys/texture_set_ddf.proto:5:1: warning: Import ddf/ddf_math.proto is unused.
[exec] gamesys/camera_ddf.proto:4:1: warning: Import ddf/ddf_extensions.proto is unused.
[exec] gamesys/camera_ddf.proto:5:1: warning: Import ddf/ddf_math.proto is unused.
[exec] gamesys/model_ddf.proto:5:1: warning: Import ddf/ddf_math.proto is unused.
[exec] gameobject/lua_ddf.proto:5:1: warning: Import ddf/ddf_math.proto is unused.
[exec] gamesys/mesh_ddf.proto:6:1: warning: Import ddf/ddf_math.proto is unused.
[exec] engine/engine_ddf.proto:5:1: warning: Import ddf/ddf_math.proto is unused.
[exec] engine/engine_ddf.proto:4:1: warning: Import ddf/ddf_extensions.proto is unused.
[exec] gameobject/properties_ddf.proto:5:1: warning: Import ddf/ddf_math.proto is unused.
[exec] gameobject/properties_ddf.proto:4:1: warning: Import ddf/ddf_extensions.proto is unused.
[exec] gamesys/sound_ddf.proto:5:1: warning: Import ddf/ddf_math.proto is unused.
[exec] script/sys_ddf.proto:5:1: warning: Import ddf/ddf_math.proto is unused.
[exec] script/sys_ddf.proto:4:1: warning: Import ddf/ddf_extensions.proto is unused.
[exec] script/ddf_script.proto:4:1: warning: Import ddf/ddf_extensions.proto is unused.
[exec] resource/resource_ddf.proto:5:1: warning: Import ddf/ddf_math.proto is unused.
[exec] resource/resource_ddf.proto:4:1: warning: Import ddf/ddf_extensions.proto is unused.
[exec] resource/liveupdate_ddf.proto:4:1: warning: Import ddf/ddf_extensions.proto is unused.
[exec] resource/liveupdate_ddf.proto:5:1: warning: Import ddf/ddf_math.proto is unused.
[exec] render/font_ddf.proto:5:1: warning: Import ddf/ddf_math.proto is unused.
[exec] input/input_ddf.proto:4:1: warning: Import ddf/ddf_extensions.proto is unused.
[exec] input/input_ddf.proto:5:1: warning: Import ddf/ddf_math.proto is unused.
[copy] Copying 2 files to C:\Sources\Arenum\defold_141\com.dynamo.cr\com.dynamo.cr.bob\lib
[copy] Copying 5 files to C:\Sources\Arenum\defold_141\com.dynamo.cr\com.dynamo.cr.bob\libexec\x86_64-macos
[copy] Copying 5 files to C:\Sources\Arenum\defold_141\com.dynamo.cr\com.dynamo.cr.bob\libexec\x86_64-linux
[copy] Copying 5 files to C:\Sources\Arenum\defold_141\com.dynamo.cr\com.dynamo.cr.bob\libexec\x86_64-win32
[javac] Compiling 32 source files to C:\Sources\Arenum\defold_141\com.dynamo.cr\com.dynamo.cr.bob\build
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] Compiling 135 source files to C:\Sources\Arenum\defold_141\com.dynamo.cr\com.dynamo.cr.bob\build
[javac] C:\Sources\Arenum\defold_141\com.dynamo.cr\com.dynamo.cr.bob\src\com\dynamo\bob\pipeline\OggBuilder.java:36: error: cannot find symbol
[javac] List<String> deps = List.of("libogg", "liboggz");
[javac] ^
[javac] symbol: method of(String,String)
[javac] location: interface List
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 1 error
And when JDK11 goes first in the PATH environment variable, I have another error:
-Djava.ext.dirs=c:\Sources\Arenum\defold_141\tmp\android\android-sdk\build-tools\33.0.1\lib is not supported. Use -classpath instead.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Error running d8
feature 'web' does not exist - bind at least one method to it?
Waf: Leaving directory `C:\Sources\Arenum\defold_141\engine\engine\build'
Build failed
-> task in 'dmengine' failed with exit status 1 (run with -v to display more information)
Traceback (most recent call last):
File "C:\Sources\Arenum\defold_141\scripts\build.py", line 2261, in <module>
f()
File "C:\Sources\Arenum\defold_141\scripts\build.py", line 1111, in build_engine
self._build_engine_lib(args, lib, target_platform)
File "C:\Sources\Arenum\defold_141\scripts\build.py", line 1050, in _build_engine_lib
run.env_command(self._form_env(), args + plf_args + self.waf_options + skip_build_tests, cwd = cwd)
File "C:\Sources\Arenum\defold_141\build_tools\run.py", line 98, in env_command
return _exec_command(args, shell = False, stdout = None, env = env, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Sources\Arenum\defold_141\build_tools\run.py", line 75, in _exec_command
raise e
run.ExecException: 1
As far as I understand, I need to use the JDK11 compiler and JDK8 libraries, but how do I achieve this?