2
votes

So I have downloaded Telegram messenger source from GitHub, and I am trying to get it to run on Android Studio for the first time. Now the error is as below:

The build failed message is:

Error:error: CreateProcess: No such file or directory

The detailed log in Gradle Console is:

FAILURE: Build failed with an exception.

  • What went wrong:

    Execution failed for task ':TMessagesProj:externalNativeBuildArmv7Debug'.

Build command failed. Error while executing process D:\AndroidStudio\sdk\ndk-bundle\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\TMessagesProj\jni\Android.mk NDK_APPLICATION_MK=C:\TMessagesProj\jni\Application.mk APP_ABI=armeabi-v7a NDK_ALL_ABIS=armeabi-v7a NDK_DEBUG=1 APP_PLATFORM=android-14 NDK_OUT=C:/TMessagesProj/build/intermediates/ndkBuild/armv7/debug/obj NDK_LIBS_OUT=C:\TMessagesProj\build\intermediates\ndkBuild\armv7\debug\lib NDK_APPLICATION_MK:=jni/Application.mk APP_PLATFORM:=android-14 C:/TMessagesProj/build/intermediates/ndkBuild/armv7/debug/obj/local/armeabi-v7a/libtmessages.26.so}
[armeabi-v7a] SharedLibrary : libtmessages.26.so
arm-linux-androideabi-g++: error: CreateProcess: No such file or directory
make: ***
[C:/TMessagesProj/build/intermediates/ndkBuild/armv7/debug/obj/local/armeabi-v7a/libtmessages.26.so] Error 1

When I check the directory addressed in the log, I don't find a file named libtmessages.26.so. I don't know what is wrong. I don't know much about C++ and GCC so I appreciate any detailed helps.

Good to mention that prior to this error, I had a "redefinition in struct" error. When I focused, I found out there were repetitive definitions of two classes in two link.h files, one in the project and another in my sdk\ndk-bundle directory. So I commented the conflicts in link.h in my sdk, and I faced the above error. But weird was when I uncommented those parts, I expected to see the redefinition error again, but surprisingly nothing changed and I still got the above error.

Anyway, any help is appreciated. Thanks in advance.

1
Which version of NDK do you have? Try running ndk-build from command line: go to C:\TMessagesProj and run D:\AndroidStudio\sdk\ndk-bundle\ndk-build.cmd APP_ABI=armeabi-v7a APP_PLATFORM=android-14Alex Cohn
It's latest version of NDK, which is 15th revision (r-15)saraX
Try to explicitly set ANDROID_DEPRECATED_HEADERS=true. What does your command-line build say?Alex Cohn
Thanks! where should I exactly put the line of code? If in Gradle, then where in Gradle?saraX
Add it to the arguments setting in build.gardle.Alex Cohn

1 Answers

0
votes

Add below line at the first of your Android.mk file that is in JNI folder.

LOCAL_SHORT_COMMANDS := true

And then add following line at the first of your Application.mk file that is in JNI folder too.

APP_SHORT_COMMANDS := true

If this could not solved your problem and you have some errors yet, then try to use MULTIDEX in your build process. You can find many tutorials out there about how to enable it.