适用于Android的电报,令人困惑的NDK错误 [英] Telegram for Android, confusing NDK error

查看:288
本文介绍了适用于Android的电报,令人困惑的NDK错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我已经从GitHub下载了Telegram Messenger的源代码,并且我试图使其首次在Android Studio上运行.现在错误如下:

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:

构建失败的消息是:

错误:错误:CreateProcess:没有这样的文件或目录

Error:error: CreateProcess: No such file or directory

Gradle控制台中的详细日志为:

The detailed log in Gradle Console is:

失败:构建失败,并出现异常.

FAILURE: Build failed with an exception.

  • 出了什么问题:

  • What went wrong:

任务':TMessagesProj:externalNativeBuildArmv7Debug'的执行失败.

Execution failed for task ':TMessagesProj:externalNativeBuildArmv7Debug'.

构建命令失败. 执行进程D:\ AndroidStudio \ sdk \ ndk-bundle \ ndk-build.cmd时出错,参数为{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 \ Build \ intermediates \ 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]共享库:libtmessages.26.so
arm-linux-androideabi-g ++:错误:CreateProcess:没有这样的文件或目录
make:***
[C:/TMessagesProj/build/intermediates/ndkBuild/armv7/debug/obj/local/armeabi-v7a/libtmessages.26.so]错误1

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

当我检查日志中寻址的目录时,找不到名为libtmessages.26.so的文件.我不知道怎么了我对C ++和GCC不太了解,所以我感谢任何详细的帮助.

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.

值得一提的是,在发生此错误之前,我遇到了结构中的重新定义"错误.当我集中精力时,我发现在两个link.h文件中有两个类的重复定义,一个在项目中,另一个在我的sdk \ ndk-bundle目录中.因此,我在sdk中评论了link.h中的冲突,并且遇到了上述错误.但是很奇怪的是,当我取消注释那些零件时,我希望再次看到重新定义错误,但是令人惊讶的是,没有任何变化,并且我仍然遇到上述错误.

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.

推荐答案

在JNI文件夹中的Android.mk文件的第一行添加以下行.

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

LOCAL_SHORT_COMMANDS := true

然后在JNI文件夹中的Application.mk文件的第一行中添加以下行.

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

APP_SHORT_COMMANDS := true

如果这不能解决您的问题,并且还存在一些错误,请尝试在构建过程中使用MULTIDEX.您可以在那里找到许多有关如何启用它的教程.

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.

这篇关于适用于Android的电报,令人困惑的NDK错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆