The main problem is that you’re running the project without generating the native library from the C/C++ codes. Because of that project based on Telegram, which you point it out with the link, has the file Android.mk
on the jni
directory , you have to compile the code manually. I fixed that exception following these steps:
- Check that
build.gradle
contains:
source version 3.13.1 and newer:
sourceSets.main.jniLibs.srcDirs = ['./jni/']
source version lower than 3.13.1:
sourceSets.main { jniLibs.srcDirs="libs" jni.srcDirs = [] //disable automatic ndk-build call }
- Download the NDK
Proceed according to your operating system.
Linux / Mac
$ cd <path-to-Telegram>/TMessagesProj
$ <path-to-ndk>/ndk-build
Windows
- Download Cygwin
-
Add on
.bashrc
file, which is placed on Cygwin root directory (use some utility to find that file). In my case, the file was placed inC:\cygwin64\home\myuser
.export ndkbuild=/cygdrive/partition_name/your_ndk_directory/ndk-build.cmd
-
Open the Cygwin terminal and move yourself towards the
jni
directory of the project:cd /cygdrive/your_partition_name/project_jni_directory_path
-
Write
$ndkbuild
and wait the compiler finishes its task. If this process is right, two directories will show up,obj
andlibs
. Check thatlibs
directory contains some library with.so
extension. Finally, run the project.