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

How to use tdlib in android studio (java) #1904

Closed
cheaterNo1 opened this issue Mar 26, 2022 · 5 comments
Closed

How to use tdlib in android studio (java) #1904

cheaterNo1 opened this issue Mar 26, 2022 · 5 comments

Comments

@cheaterNo1
Copy link

Unlike all the other libs, tdlib is quite difficult to install. What I did:

  • Install CMake.
  • Download tdlib.zip from https://core.telegram.org/tdlib/tdlib.zip.
  • Unzip tdlib.zip:
    • Create jniLibs folder in myProject src/main/ and copy 4 folders from libtd/src/main/libs/ to jniLibs
    • Copy the corresponding Java classes to myProject src/main/java/

p1

And when I try to run NativeClient, it show:

p2

What should I do for now?

@levlam
Copy link
Contributor

levlam commented Apr 6, 2022

Have you added

android {
    sourceSets {
        main {
            jniLibs.srcDirs = ['src/main/jniLibs']
        }
    }
}

to your build.gradle?

@cheaterNo1
Copy link
Author

p1

Nothing changes !

@levlam
Copy link
Contributor

levlam commented Apr 9, 2022

This should be enough to find libtdjni.so in subdirectories of jniLibs.

You may also need jni.srcDirs = [], but only to prevent attempts to build native libraries:

    sourceSets.main {
        jniLibs.srcDir 'src/main/jniLibs'
        jni.srcDirs = [] //disable automatic ndk-build call
    }

@cheaterNo1
Copy link
Author

p1

@levlam levlam closed this as completed Sep 25, 2022
@vniiphone
Copy link

Unlike all the other libs, tdlib is quite difficult to install. What I did:

  • Install CMake.

  • Download tdlib.zip from https://core.telegram.org/tdlib/tdlib.zip.

  • Unzip tdlib.zip:

    • Create jniLibs folder in myProject src/main/ and copy 4 folders from libtd/src/main/libs/ to jniLibs
    • Copy the corresponding Java classes to myProject src/main/java/

p1

And when I try to run NativeClient, it show:

p2

What should I do for now?

did you solved ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants