简体   繁体   English

我们如何将CMake或ndk-build集成到Android Studio 3.0.1中? Gradle版本为4.1,Android插件版本3.0.1

[英]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.

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.

相关问题 带有gradle build 4.1的android studio 3.0.1中的Gradle同步错误 - Gradle sync error in android studio 3.0.1 with gradle build 4.1 关于最新的android studio 3.0.1的Gradle 4.1问题 - Gradle 4.1 issue on latest android studio 3.0.1 错误:android studio 3.0.1 中支持的最低 gradle 版本为 4.6 - Error : minimum supported gradle version is 4.6 in android studio 3.0.1 将 Android Studio 的 Gradle 插件升级到 3.0.1 和 Gradle 到 4.1 后无法复制配置依赖项 - Not able to copy configurations dependencies after upgrading Gradle plugin for Android Studio to 3.0.1 and Gradle to 4.1 将Android Studio更新到3.0.1版本后出现错误 - Error after updating android studio to 3.0.1 version Android ProGuard使用gradle插件3.0.1(4.1?)构建已签名的apk失败 - Android ProGuard Building a signed apk fails with gradle plugin 3.0.1 (4.1?) 数据绑定Android Studio Gradle 3.0.1 - Databinding Android Studio Gradle 3.0.1 Android Studio 3.0.1 gradle build pkix 路径构建失败 - Android Studio 3.0.1 gradle build pkix pathbuilding failed 调试Android Studio 2.2 CMake与NDK-Build - Debugging Android Studio 2.2 CMake vs NDK-Build android studio项目中CMake和NDK-build之间的区别 - Difference between CMake and NDK-build in android studio project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM