td icon indicating copy to clipboard operation
td copied to clipboard

tdjson jni method invoke error

Open liuykk opened this issue 9 months ago • 2 comments

Exception in thread "main" java.lang.UnsatisfiedLinkError: org.drinkless.tdlib.JsonClient.setLogMessageHandler(ILorg/drinkless/tdlib/JsonClient$LogMessageHandler;)V

liuykk avatar Apr 10 '25 06:04 liuykk

Check that you use only JsonClient.java and link with libtdjni.so built with tdjson interface using the option -DTD_JSON_JAVA=ON.

levlam avatar Apr 10 '25 11:04 levlam

Had same issue, resolved by this command at 2nd phase of compilation for java:

cd example/java Remove-Item build -Force -Recurse -ErrorAction SilentlyContinue mkdir build cd build cmake -A x64 -DCMAKE_INSTALL_PREFIX:PATH=../../../tdlib -DTD_JSON_JAVA=ON -DCMAKE_TOOLCHAIN_FILE:FILEPATH=../../../vcpkg/scripts/buildsystems/vcpkg.cmake -DTd_DIR:PATH=$(Resolve-Path ../td/lib/cmake/Td) ..

@levlam I think need to add information about this arg to readme because no information about it

Teramaks avatar Sep 22 '25 10:09 Teramaks