I downloaded Telegram Source code from GitHub and Compile it. at first, it gave me some error about NDK_PROJECT_PATH = null
and so as someone suggested i changed :
sourceSets.main.jniLibs.srcDirs = ['./jni/']
externalNativeBuild {
ndkBuild {
path "jni/Android.mk"
}
}
to :
sourceSets.main {
jniLibs.srcDir 'libs'
jni.srcDirs = [] //disable automatic ndk-build call
}
in gradle.
after run 2 .so file generated in libs\armeabi
and libs\armeabi-v7a
(both of them about 4kb) and i can get the LaunchActivity.java , but when i click on START MESSAGING the app crashes at ApplicationLoader.loadWallpaper();
(in LaunchActivity.java) which runs a runnable. i debbuged it until i reached to uncaughtException
which was as following :
unsatisfiedlinkerror native method not found: org.telegram.messenger.Utilities.pinBitmap: (Landroid/graphics/Bitmap;)
after that i again compile native jni Manualy from command prompt (i mean going to nji parent folder and run ndk-build.cmd) .
when compilation finished "obj" folder was created in nji parent folder and that 2 files generated again but with size of 14kb.
I replace them with old ones in the libs folder.
after Clean and Rerun, i still have same error (native method not found...).
can any body help me what's wrong with this NDK ??
any help would be appreciated.
Thanks, MA.