-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
How to build .so file for android? #77
Comments
You can use our Java example to build the library for Android yourself. It could be used almost without modifications. You can also download prebuilt Android library available at http://core.telegram.org/tdlib/tdlib.zip. |
I follow the instruction but it's not generate .so file. i want to know how to get .so file from this library like the prebuilt Android library at http://core.telegram.org/tdlib/tdlib.zip. |
What instructions you have followed? |
this one example/java |
To build TDLib for Android you need to use Android NDK. You can use JNI bindings from Java example, but CMakeLists.txt should be adopted to build everything using NDK. |
can you give me a instruction to how to do it? |
We will publish example project later. |
I tried to use prebuilt Android library available at http://core.telegram.org/tdlib/tdlib.zip, but for some reason I always received error: "File "/td.binlog" can't be opened/created for reading and writing" |
You haven't specified databaseDirectory available for writing in setTdlibPatameters. |
Lion, I got to this meat. Which compilation flags will you recommend? (in files Android.mk, Application.mk)
|
We recommend to use CMake for Android builds, which automatically will manage all dependencies. |
Lion td_json_client_create() - managed to collect |
You need to link against tdclient, tdutils and other libraries. |
Good. Yesterday I came to this. |
cmake(ndk) log
It's time to rejoice. But it's too early.
gperf and readline? :) |
@isopen you need to run native build first with
to generate some source files. |
@levlam Many thanks. Now there is no error.
Warning can be ignored for example with the flag Changed to Clang. This place has passed without error. Warnings are the same.
Fixed StringBuilder.cpp for the current build (delete std) TODO:: there meat.
Did not appear libtdjson.so(joke). Perhaps it's warnings and errors in the assembly. libtdjson.so(weight 150mb) appeared in the /home/user/proj/td/jnibuild/ |
Something wrong with yours TDLib source code. There is no c == '16' on this line: td/tdutils/td/utils/JsonBuilder.cpp Line 433 in 6c706f4
as there is no line
For Android it is better to use |
Yes '16' is just not a critical warning(it does not apply to your code). I'm sorry my girlfriend added this. I'll try to explain to her about the type char. i try
This is not very critical.:)) That's what I'm interested:
|
|
Good. (1) This is not about the current manual :)
|
This error occurs if you do
What to do? |
"error: /usr/lib/jvm/java-8-openjdk-i386/jre/lib/i386/server/libjvm.so: incompatible target" is because you have removed check |
I'm using this CMake to build (It seems to be part of the NDK) |
Correct JNI headers can be found inside Android NDK. I'm not sure that you need to link with JRE libraries on Android at all when JNI is used. |
Can you drop the already prepared cmake(ndk) command with which you collected? |
We built TDLib for Android inside Android Studio project. It is hard to drop the whole project, but we will be publish it in the future. |
It's brilliant. Can you somehow pull out the build.gradle files? |
@TomyChu90 Ensure that you copied all java source files without changing their package. |
@Tamada4a |
@levlam Do you mean Program Files_(x86)? |
export PATH="$ANDROID_NDK"/toolchains/llvm/prebuilt/$HOST_ARCH/bin:"$PATH" |
I fixed some problems, but now i have this one:
build.sh: export PATH="$ANDROID_NDK/toolchains/llvm/prebuilt/$HOST_ARCH/bin:$PATH" |
@Tamada4a The correct NDK path would be |
@levlam if I use the correct path, I get the following error: |
in new versions change td_api.tlo path in Cmake file, when build jni archive |
Now you can use https://github.com/tdlib/td/tree/master/example/android to build |
@levlam hi, I need to build libtdjsonandroid.so can you send me the script? |
@levlam I modify the current make file to build libtdjsonandroid, it looks ok now. Thanks. |
I have an idea. There will be a type of park that cannot be deleted. All posts will be randomly placed in this folder. I'll send you a ready-made pezultat soon. romausnul@gmail.com |
Good evening! I'm building the TDLib library for Telegram. It will be used on Android. We assemble in Windows OS. When running the command "./build-openssl.sh" an error occurs: process_begin: CreateProcess(NULL, aarch64-linux-android21-clang -Iinclude -Iproviders/implementations/include -Iproviders/common/include -fPIC -pthread -Wa,--noexecstack -Qunused-arguments -Wall -O3 -ffunction-sections -fdata-sections -U__ANDROID_API__ -DOPENSSL_BUILDING_OPENSSL -DNDEBUG -D__ANDROID_API__=21 -MMD -MF providers/legacy-dso-legacyprov.d.tmp -MT providers/legacy- Please tell me how to fix it? |
@MorozovStVl |
I'm just using this example to build for Android. Tell me, do the Dockerfile need to be launched by some program? Please guide me. I haven't encountered Dockerfile before |
The README contains the exact command to be invoked: Line 24 in fe62015
You can download and install Docker at https://www.docker.com/products/docker-desktop/. |
I used libtdjsonandroid.zip for my android app, is that possible to built .so file for my app in Macos |
I have problem with openssl always : Ps: I did as instructions for libtdjsonandroid |
If you want to build TDLib for macOS, you need to follow the instructions at https://tdlib.github.io/td/build.html. If you want to build TDLib for Android, then see https://github.com/tdlib/td/tree/master/example/android. |
Now you can use the Android example to build TDLib for Android. |
ok, understood, thanks a lot
…On Mon, Jun 3, 2024 at 3:55 PM Aliaksei Levin ***@***.***> wrote:
Now you can use the Android example
<https://github.com/tdlib/td/tree/master/example/android> to build TDLib
for Android.
—
Reply to this email directly, view it on GitHub
<#77 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/A4QJ2WA24LFP7UOMMITDIZDZFRDQJAVCNFSM4EQNCYAKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMJUGQ4DSMZXGE3Q>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
i'm on Mac and could not found a way to build .so file for android. any solution?
The text was updated successfully, but these errors were encountered: