Script encryption error for android

Godot Version

Godot 3.5.2-stable

Question

Hello guys, I know that 3.5.2-stable, already outdated, even some documentation is worn out. But still, how can you encrypt a script for an apk, I managed to do this for a cpk, but there’s a problem with the apk, as I understand it, you need your own export templates for this? I have SDK 30.0.3, NDK 23.2.8568313, I compile: scons -j8 platform=android target=release tools=no android_arch=armv7 module_script_encryption_key=“key” and get an error like this.

 [100%] progress_finish(["progress_finish"], [])
[100%] Linking Static Library ==> core\libcore.android.opt.armv7.neon.a
[100%] Linking Shared Library ==> bin\libgodot.android.opt.armv7.neon.so
=====
b'ld: error: undefined symbol: init_thread_jandroid(_JavaVM*, _JNIEnv*)
\r\n>>> 
referenced by java_godot_lib_jni.cpp
platform\\android\\java_godot_lib_jni.os:(Java_org_godotengine_godot_GodotLib_initialize)

nld: error: undefined symbol: DirAccessJAndroid::setup(_jobject*)
\r\n>>>
referenced by java_godot_lib_jni.cpp
platform\\android\\java_godot_lib_jni.os:(Java_org_godotengine_godot_GodotLib_initialize)

nld: error: undefined symbol: FileAccessFilesystemJAndroid::setup(_jobject*)
\r\n>>>
referenced by java_godot_lib_jni.cpp
platform\\android\\java_godot_lib_jni.os:(Java_org_godotengine_godot_GodotLib_initialize)

nld: error: undefined symbol: NetSocketAndroid::setup(_jobject*)
r\n>>>
referenced by java_godot_lib_jni.cpp
platform\\android\\java_godot_lib_jni.os:(Java_org_godotengine_godot_GodotLib_initialize)

error: undefined symbol: OS_Android::OS_Android(GodotJavaWrapper*, GodotIOJavaWrapper*, bool)
referenced by java_godot_lib_jni.cpp
platform\\android\\java_godot_lib_jni.os:(Java_org_godotengine_godot_GodotLib_initialize)

error: undefined symbol: FileAccessAndroid::asset_manager
referenced by java_godot_lib_jni.cpp
platform\\android\\java_godot_lib_jni.os:(Java_org_godotengine_godot_GodotLib_initialize)

error: undefined symbol: OS_Android::main_loop_end()
referenced by java_godot_lib_jni.cpp
platform\\android\\java_godot_lib_jni.os:(Java_org_godotengine_godot_GodotLib_ondestroy)
referenced by java_godot_lib_jni.cpp
platform\\android\\java_godot_lib_jni.os:(Java_org_godotengine_godot_GodotLib_newcontext)

error: undefined symbol: setup_android_thread()
referenced by java_godot_lib_jni.cpp
platform\\android\\java_godot_lib_jni.os:(Java_org_godotengine_godot_GodotLib_setup)

error: undefined symbol: get_jni_env()
referenced by java_godot_lib_jni.cpp
platform\\android\\java_godot_lib_jni.os:(Java_org_godotengine_godot_GodotLib_setup)
referenced by java_godot_lib_jni.cpp
platform\\android\\java_godot_lib_jni.os:(Java_org_godotengine_godot_GodotLib_joyconnectionchanged)
referenced by java_godot_lib_jni.cpp
platform\\android\\java_godot_lib_jni.os:(Java_org_godotengine_godot_GodotLib_getGlobal)
referenced 22 more times

nld: error: undefined symbol: OS_Android::ANDROID_EXEC_PATH
referenced by java_godot_lib_jni.cpp
platform\\android\\java_godot_lib_jni.os:(Java_org_godotengine_godot_GodotLib_setup)
referenced by java_godot_lib_jni.cpp
platform\\android\\java_godot_lib_jni.os:(Java_org_godotengine_godot_GodotLib_setup)
referenced by java_godot_lib_jni.cpp
platform\\android\\java_godot_lib_jni.os:(Java_org_godotengine_godot_GodotLib_setup)

nld: error: undefined symbol: OS_Android::set_display_size(Vector2)
referenced by java_godot_lib_jni.cpp
platform\\android\\java_godot_lib_jni.os:(Java_org_godotengine_godot_GodotLib_resize)

nld: error: undefined symbol: OS_Android::set_offscreen_gl_available(bool)
referenced by java_godot_lib_jni.cpp
platform\\android\\java_godot_lib_jni.os:(Java_org_godotengine_godot_GodotLib_newcontext)

nld: error: undefined symbol: OS_Android::main_loop_begin()
referenced by java_godot_lib_jni.cpp
platform\\android\\java_godot_lib_jni.os:(Java_org_godotengine_godot_GodotLib_step)

nld: error: undefined symbol: OS_Android::process_accelerometer(Vector3 const&)
referenced by java_godot_lib_jni.cpp
platform\\android\\java_godot_lib_jni.os:(Java_org_godotengine_godot_GodotLib_step)

nld: error: undefined symbol: OS_Android::process_gravity(Vector3 const&)
referenced by java_godot_lib_jni.cpp
platform\\android\\java_godot_lib_jni.os:(Java_org_godotengine_godot_GodotLib_step)

nld: error: undefined symbol: OS_Android::process_magnetometer(Vector3 const&)
referenced by java_godot_lib_jni.cpp
platform\\android\\java_godot_lib_jni.os:(Java_org_godotengine_godot_GodotLib_step)

nld: error: undefined symbol: OS_Android::process_gyroscope(Vector3 const&)
referenced by java_godot_lib_jni.cpp
platform\\android\\java_godot_lib_jni.os:(Java_org_godotengine_godot_GodotLib_step)

nld: error: undefined symbol: OS_Android::main_loop_iterate(bool*)
referenced by java_godot_lib_jni.cpp
platform\\android\\java_godot_lib_jni.os:(Java_org_godotengine_godot_GodotLib_step)

nld: error: undefined symbol: AndroidInputHandler::process_mouse_event(int, int, Vector2, float, float)
referenced by java_godot_lib_jni.cpp
platform\\android\\java_godot_lib_jni.os:(touch_preprocessing)

nld: error: undefined symbol: AndroidInputHandler::process_touch(int, int, Vector<AndroidInputHandler::TouchPos> const&)
referenced by java_godot_lib_jni.cpp
platform\\android\\java_godot_lib_jni.os:(touch_preprocessing)

nld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

please tell me what am I doing wrong?

P.s.
Use python 3.6.1+ scons-local 4.6.0.

git clone GitHub - godotengine/godot: Godot Engine – Multi-platform 2D and 3D game engine
cd godot
git checkout 3.5.2-stable

I would be grateful for any help or hint.

I don’t know how this happened, but when I checked manually, I found some files to be empty. For example platform/android/os_android.cpp.

git status
HEAD detached at 3.5.2-stable
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   platform/android/android_input_handler.cpp
        modified:   platform/android/audio_driver_opensl.cpp
        modified:   platform/android/dir_access_jandroid.cpp
        modified:   platform/android/file_access_android.cpp
        modified:   platform/android/file_access_filesystem_jandroid.cpp
        modified:   platform/android/net_socket_android.cpp
        modified:   platform/android/os_android.cpp
        modified:   platform/android/thread_jandroid.cpp

I did reset

git reset --hard

And I recompiled and the errors went away.
I hope this will be useful to someone.

P.S. It remains a mystery to me why these files were empty.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.