[英]How can we Integrate CMake or ndk-build into Android Studio 3.0.1? Gradle version is 4.1, android plugin version 3.0.1
I am trying to integrate openCV 2.4.9 into my android project, integration was successfully done, but when i build the project to check the integration the this error comes 我正在尝试将openCV 2.4.9集成到我的android项目中,集成成功完成,但是当我构建项目以检查集成时,会出现此错误
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':app:compileDebugNdk'. 出了什么问题:任务':app:compileDebugNdk'的执行失败。
Error: Your project contains C++ files but it is not using a supported native build system.
错误:您的项目包含C ++文件,但未使用受支持的本机生成系统。 Consider using CMake or ndk-build integration.
考虑使用CMake或ndk-build集成。 For more information, go to: https://d.android.com/r/studio-ui/add-native-code.html Alternatively, you can use the experimental plugin: https://developer.android.com/r/tools/experimental-plugin.html
有关更多信息,请访问: https : //d.android.com/r/studio-ui/add-native-code.html或者,您可以使用实验性插件: https : //developer.android.com/r /tools/experimental-plugin.html
Try: Run with --stacktrace option to get the stack trace. 尝试:使用--stacktrace选项运行以获取堆栈跟踪。 Run with --info or --debug option to get more log output.
使用--info或--debug选项运行以获取更多日志输出。
Get more help at https://help.gradle.org 在https://help.gradle.org上获得更多帮助
BUILD FAILED in 5s 5秒内失败
so how could i solve this problem Note:: when i integrate OpenCV 3.0.1 into my android project then there was no error of this kind then why this error comes when i integrate openCV249? 所以我怎么解决这个问题注意:当我将OpenCV 3.0.1集成到我的android项目中时,没有此类错误,那么为什么在集成openCV249时出现此错误?
please I am new to android development so give me detailed answer. 请我是android开发的新手,所以给我详细的答案。
Even if you use the sources of this old version of OpenCV, you still need to comply with the modern gradle build environment. 即使您使用此旧版本的OpenCV的源代码,也仍然需要遵守现代的gradle构建环境。 The best route would be to take the build.gradle files from ver.
最好的方法是从ver.com.cn获取build.gradle文件。 3.0.1 and apply them to 2.4.9 (try to make as few changes as possible).
3.0.1并将它们应用到2.4.9(尝试进行尽可能少的更改)。
This version of OpenCV was frozen at the time when NDK release was r9d . 此版本的OpenCV在r9d发行NDK时被冻结 。 This is quite outdated, and it has many problems when building the app for modern devices.
这已经过时了,在为现代设备构建应用程序时会遇到很多问题。 I would recommend to upgrade to Android NDK r14b (again, if your build fails, the minimal necessary patch is expected to be quite small).
我建议升级到Android NDK r14b (同样,如果构建失败,则所需的最小修补程序应该很小)。 If you have courage to upgrade further - to current Latest Stable Version (r16b) , you should follow the NDK documents that explain how the new Unified headers change the ndk-build configuration (Android.mk) files.
如果您有勇气进一步升级-升级到当前的最新稳定版本(r16b) ,则应遵循NDK文档,该文档解释了新的Unified标头如何更改ndk-build配置(Android.mk)文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.