我在Eclipse中导入OpenCV库后遇到了错误。我想我做了我应该做的但也许我错过了一些东西。样本没有错误,但是我的应用程序也有,也有OpenCV Library-2.4.10。
以下是我的输出结果:
问题
Description Resource Path Location Type
make: *** Android NDK: Aborting... . Stop. Cammect line 209, external location: /home/crash-id/Development/SDK/android-ndk-r10c/build/core/add-application.mk C/C++ Problem
make: *** Android NDK: Aborting... . Stop. OpenCV Library - 2.4.10 line 209, external location: /home/crash-id/Development/SDK/android-ndk-r10c/build/core/add-application.mk C/C++ Problem
make: *** Android NDK: Aborting... . Stop. src line 209, external location: /home/crash-id/Development/SDK/android-ndk-r10c/build/core/add-application.mk C/C++ Problem
make: *** No rule to make target `clean'. Stop. RemoteSystemsTempFiles C/C++ Problem
控制台:
22:21:19 **** Clean-only build of configuration Default for project OpenCV Library - 2.4.10 ****
/home/crash-id/Development/SDK/android-ndk-r10c/ndk-build clean
Android NDK: WARNING: APP_PLATFORM android-14 is larger than android:minSdkVersion 8 in ./AndroidManifest.xml
Android NDK: Your APP_BUILD_SCRIPT points to an unknown file: ./jni/Android.mk
/home/crash-id/Development/SDK/android-ndk-r10c/build/core/add-application.mk:209: *** Android NDK: Aborting... . Stop.
22:21:19 Build Finished (took 132ms)
错误日志:
eclipse.buildId=4.4.1.M20140925-0400
java.version=1.8.0_31
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments: -product org.eclipse.epp.package.jee.product
Command-line arguments: -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.jee.product
org.eclipse.jdt.core
Error
Sun Feb 08 22:21:23 EET 2015
Invalid ZIP archive: /home/crash-id/Development/SDK/adt-bundle-linux-x86_64-20140702/sdk/extras/android/support/v7/appcompat/bin/android-support-v7-appcompat.jar
eclipse.buildId=4.4.1.M20140925-0400
java.version=1.8.0_31
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments: -product org.eclipse.epp.package.jee.product
Command-line arguments: -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.jee.product
org.eclipse.cdt.core
Error
Sun Feb 08 21:45:35 EET 2015
Error: Cannot run program "/ndk-build": Unknown reason
java.io.IOException: Cannot run program "/ndk-build": Unknown reason
at org.eclipse.cdt.utils.spawner.Spawner.exec(Spawner.java:349)
at org.eclipse.cdt.utils.spawner.Spawner.<init>(Spawner.java:91)
at org.eclipse.cdt.utils.spawner.ProcessFactory.exec(ProcessFactory.java:91)
at org.eclipse.cdt.core.CommandLauncher.execute(CommandLauncher.java:194)
at org.eclipse.cdt.internal.core.BuildRunnerHelper.build(BuildRunnerHelper.java:263)
at org.eclipse.cdt.managedbuilder.core.ExternalBuildRunner.invokeExternalBuild(ExternalBuildRunner.java:128)
at org.eclipse.cdt.managedbuilder.core.ExternalBuildRunner.invokeBuild(ExternalBuildRunner.java:72)
at org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.build(CommonBuilder.java:753)
at org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.build(CommonBuilder.java:510)
at org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.build(CommonBuilder.java:459)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:734)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:299)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:302)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:358)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:381)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
eclipse.buildId=4.4.1.M20140925-0400
java.version=1.8.0_31
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments: -product org.eclipse.epp.package.jee.product
Command-line arguments: -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.jee.product
org.eclipse.cdt.core
Error
Sun Feb 08 21:45:35 EET 2015
Error: Cannot run program "/ndk-build": Unknown reason
java.io.IOException: Cannot run program "/ndk-build": Unknown reason
at org.eclipse.cdt.utils.spawner.Spawner.exec(Spawner.java:349)
at org.eclipse.cdt.utils.spawner.Spawner.<init>(Spawner.java:91)
at org.eclipse.cdt.utils.spawner.ProcessFactory.exec(ProcessFactory.java:91)
at org.eclipse.cdt.core.CommandLauncher.execute(CommandLauncher.java:194)
at org.eclipse.cdt.internal.core.BuildRunnerHelper.build(BuildRunnerHelper.java:263)
at org.eclipse.cdt.managedbuilder.core.ExternalBuildRunner.invokeExternalBuild(ExternalBuildRunner.java:128)
at org.eclipse.cdt.managedbuilder.core.ExternalBuildRunner.invokeBuild(ExternalBuildRunner.java:72)
at org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.build(CommonBuilder.java:753)
at org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.build(CommonBuilder.java:510)
at org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.build(CommonBuilder.java:459)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:734)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:299)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:302)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:358)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:381)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
答案 0 :(得分:0)
从您的错误日志中,您的Android NDK的路径似乎是错误的。您可以通过在Eclipse中指定Android NDK ndk-build
的完整路径来更正此问题。
首先,创建一个Build Variable
。在Eclipse中,转到Window
- &gt; Preferences
- &gt; C/C++
- &gt; Build
- &gt; Build Variables
。添加一个引用Android NDK NDK_ROOT
文件的完整路径的新变量(您可以将其命名为ndk-build
或任何您想要的名称)。
然后,点击Apply
并点击Environment
(Preferences
- &gt; C/C++
- &gt; Build
- &gt; Environment
)并添加刚刚创建的变量。点击Apply
和OK
。
然后,右键单击Open-CV-Library,然后选择Properties
。导航至C/C++ Build
- &gt; Environment
并在那里添加新创建的变量。点击Apply
和OK
。
那应该有用。这就是我修理我的方式。
我希望这会有所帮助。
修改强>
另一个修复可能是使用版本2.4.9而不是版本2.4.10,因为OpenCV网站上的当前说明适用于版本2.4.9。
答案 1 :(得分:0)
在我改为OpenCV Library 2.4.9而不是2.4.10后,错误消失了。我使用.mk文件创建了一个jni文件夹后,我的应用程序的错误消失了。