新项目上的Android Studio从c ++支持开始会产生多个错误?

时间:2019-02-01 06:43:52

标签: java android-studio android-ndk

当我使用c ++支持启动一个新项目时,新创建的项目无法在主要活动中识别本机Jni函数。 在打开我的native-lib.cpp时 这些错误正如图所示出现

Jni-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.

1 个答案:

答案 0 :(得分:1)

只需将D:\2019 android重命名为D:\2019_android,您所有的麻烦都将得到解决。