NDK Error occured while importing telegram source

2019-03-22 08:38发布

问题:

I downloaded telegram open source code for android from the following the link https://github.com/DrKLO/Telegram. While importing the project am getting the following errors:

  External Native Build Issues
  Build command failed.
  Error while executing process C:\Users\user\AppData\Local\Android\sdk\ndk 
  -bundle\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\Users\user\AndroidStudioProjects\Telegram-master\TMessagesProj\jni\Android.mk 
 NDK_APPLICATION_MK=C:\Users\user\AndroidStudioProjects\Telegram-master\TMessagesProj\jni\Application.mk APP_ABI=armeabi-v7a 
 NDK_ALL_ABIS=armeabi-v7a NDK_DEBUG=0 APP_PLATFORM=android-14 
 NDK_OUT=C:/Users/user/AndroidStudioProjects/Telegram-master/TMessagesProj/build/intermediates/ndkBuild/armv7/release/obj 
 NDK_LIBS_OUT=C:\Users\user\AndroidStudioProjects\Telegram-master\TMessagesProj\build\intermediates\ndkBuild\armv7\release\lib 
NDK_APPLICATION_MK:=jni/Application.mk APP_PLATFORM:=android-14 APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n}
Android NDK: ERROR:C:\Users\user\AndroidStudioProjects\Telegram-master\TMessagesProj\jni\Android.mk:WebRtcAec: LOCAL_SRC_FILES points to a missing file    
Android NDK: Check that C:/Users/user/AndroidStudioProjects/Telegram-master/TMessagesProj/jni/./libtgvoip/external/libWebRtcAec_android_armeabi-v7a.a exists  or that its path is correct   
process_begin: CreateProcess(NULL, "", ...) failed.
Error:executing external native build for ndkBuild 
C:\Users\user\AndroidStudioProjects\Telegram-master\TMessagesProj\jni\Android.mk
Build command failed.
Error while executing process C:\Users\user\AppData\Local\Android\sdk\ndk-bundle\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null 
APP_BUILD_SCRIPT=C:\Users\user\AndroidStudioProjects\Telegram-master\TMessagesProj\jni\Android.mk 
NDK_APPLICATION_MK=C:\Users\user\AndroidStudioProjects\Telegram-master\TMessagesProj\jni\Application.mk APP_ABI=x86 NDK_ALL_ABIS=x86 NDK_DEBUG=1 
APP_PLATFORM=android-23 
NDK_OUT=C:/Users/user/AndroidStudioProjects/Telegram-master/TMessagesProj/build/intermediates/ndkBuild/x86_SDK23/debug/obj 
NDK_LIBS_OUT=C:\Users\user\AndroidStudioProjects\Telegram-master\TMessagesProj\build\intermediates\ndkBuild\x86_SDK23\debug\lib 
NDK_APPLICATION_MK:=jni/Application.mk APP_PLATFORM:=android-14 
 APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n}
Android NDK: ERROR:C:\Users\user\AndroidStudioProjects\Telegram-master\TMessagesProj\jni\Android.mk:WebRtcAec: LOCAL_SRC_FILES points to a missing file

How do I fix these?

回答1:

The reason for your error is that the libtgvoip is a submodule and you did not clone the repository recursively so the required library has not been checked out.

To fix this go to the folder where you cloned the project and run

 git submodule update --init --recursive

This will check out the required submodule



回答2:

no contents inside jni/libtgvoip

so either do git submodule update --init --recursive or

download from here and past it inside jni/libtgvoip