How to compile telegram jni folder

后端 未结 3 1768
礼貌的吻别
礼貌的吻别 2020-12-31 23:26

I am trying to compile jni folder in telegram source code in github.com/DrKLO/Telegram/ with ndk

But when i am write ndk-build in cmd in ndk folder like:

相关标签:
3条回答
  • 2020-12-31 23:57

    Download the android-ndk Then go to the Project directory (./TMessagesProj) and execute ndk-build. Then re-run the gradle build which packages the native libs into the apk.

    0 讨论(0)
  • 2021-01-01 00:14

    Important update issue: in 3.18 version, after downloading telegram source project, if you go to jni folder you will find and empty folder named libtgvoip, to fill it with needed files: 1- go to telegram source from githum, goto jni folder and click on libtgvoip @ eb813e1 folder (@ means that this is a refrence folder). 2- download that library too! 3- copy its content in empty folder discussed earlier!

    Now lets begin: Its very easy.

    1- Add NDK directory to environment PATH variable.

    2- open Android.mk and add the following line: LOCAL_SHORT_COMMANDS := true

    3- open Application.mk and add the following line: APP_SHORT_COMMANDS := true

    4- open command prompt as administrator and navigate to jni folder like this: (important: in last version of telegram you should navigate to jni parent folder instead of jni folder)

    5- just execute ndk-build command

    Then ndk will start building .so files:

    wait until it finish the task, maybe some warnings displayed but not important. finally you will have all shared library (.so files) in the obj directory: (important: in last version of telegram .so files will create in lib folder and everything is ready to build)

    then goto each of these folders and delete everything except libtmessages.22.so. create a libs folder and copy that three directory into it:

    Build and have fun! (remember to fill out variables in org.telegram.messenger.BuildVars class with your app id and app_hash. read more here)

    0 讨论(0)
  • 2021-01-01 00:17

    Just remove the object file. This error most likely appeared after the previous build was interrupted and object file was not generated completely.

    0 讨论(0)
提交回复
热议问题