当我使用c ++支持启动一个新项目时,新创建的项目无法在主要活动中识别本机Jni函数。 在打开我的native-lib.cpp时 这些错误正如图所示出现
在运行项目时,我得到这些错误
Build command failed.
Error while executing process C:\Users\abc\AppData\Local\Android\Sdk\cmake\3.10.2.4988404\bin\cmake.exe with arguments {--build D:\2019 android\OPENCV3\app\.externalNativeBuild\cmake\debug\x86 --target native-lib}
Unknown argument android\OPENCV3\app\.externalNativeBuild\cmake\debug\x86
Usage: cmake --build <dir> [options] [-- [native-options]]
Options:
<dir> = Project binary directory to be built.
--target <tgt> = Build <tgt> instead of default targets.
May only be specified once.
--config <cfg> = For multi-configuration tools, choose <cfg>.
--clean-first = Build target 'clean' first, then build.
(To clean only, use --target 'clean'.)
--use-stderr = Ignored. Behavior is default in CMake >= 3.0.
-- = Pass remaining options to the native tool.
答案 0 :(得分:1)
只需将D:\2019 android
重命名为D:\2019_android
,您所有的麻烦都将得到解决。