简体   繁体   English

opencv4android:构建路径不完整

[英]opencv4android : build path is incomplete

I am trying to compile opencv4android library 2.4.10 on my mac using eclipse, to get to run samples. 我正在尝试使用eclipse在我的Mac上编译opencv4android库2.4.10,以运行示例。 after going through a lot of trouble, I have been successful with compiling native code. 在经历了很多麻烦之后,我已经成功地编译了本机代码。 But after that I get this error: 但是在那之后我得到了这个错误:

The project was not built since its build path is incomplete. 由于构建路径不完整,因此未构建该项目。 Cannot find the class file for java.lang.Object. 找不到java.lang.Object的类文件。 Fix the build path then try building this project OpenCV Library - 2.4.10 Unknown Java Problem. 修复构建路径,然后尝试构建此项目OpenCV Library-2.4.10 Unknown Java Problem。

I have tried to manually add JRE by going to "project properties -> java build path -> libraries" and edit the problematic library(unable to get system library for the project). 我试图通过转到“项目属性-> Java构建路径->库”来手动添加JRE,然后编辑有问题的库(无法获取该项目的系统库)。 But each time I try to edit that the only option I have is opencv library 2.4.10 - the same as project itself and I can't replace that with proper JRE. 但是每次我尝试编辑时,唯一拥有的选项就是opencv库2.4.10-与项目本身相同,并且我无法用适当的JRE替换它。

Any idea how can I fix this? 知道我该如何解决吗?

I think you have not installed the appropriate Android SDK platforms: 9 and 11 are referenced in the error message. 我认为您尚未安装适当的Android SDK平台:错误消息中引用了9和11。 This documentation describes how to set Android SDK properly with downloading more components. 本文档介绍了如何通过下载更多组件来正确设置Android SDK。

However it is not necessary to download all the missing SDKs. 但是,没有必要下载所有缺少的SDK。 You can modify the required target to your already installed one (at least target 8) in project.properties file of eg 15-puzzle's directory. 您可以在例如15-puzzle目录的project.properties文件中将所需目标修改为已经安装的目标(至少目标8)。

It seems that the problem was originating from my lack of experience in using native code in an application. 看来问题出在我缺乏在应用程序中使用本机代码的经验。 what happened was, when importing and setting up the library project, eclipse automatically changed to C/C++ perspective. 发生的事情是,在导入和设置库项目时,eclipse会自动更改为C / C ++透视图。 in which it wouldn't compile the application. 它不会编译应用程序。 as soon as I found out and change the perspective everything worked properly. 我一发现并改变了观点,一切就正常了。 as simple as that! 就如此容易!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM