【发布时间】:2016-04-20 21:55:24
【问题描述】:
在最新的 Android Studio 2.0 中,我尝试运行 ndk 示例,但构建中断并出现以下错误:
/Users/ktulsia/AndroidStudioProjects/example/app/src/main/jni/hello-jni.cpp
Error:(18, 18) string: No such file or directory
compilation terminated.
Error:Execution failed for task ':app:compileArm64-v8aDebugHello-jniSharedLibraryHello-jniMainCpp'.
> A build operation failed.
C++ compiler failed while compiling hello-jni.cpp.
See the complete log at: file:///Users/ktulsia/AndroidStudioProjects/example/app/build/tmp/compileArm64-v8aDebugHello-jniSharedLibraryHello-jniMainCpp/output.txt
【问题讨论】:
-
如果您尝试使用 C++ 库中的异常或 STL 功能,默认 NDK 编译器工具链不支持它们。你可以在这里找到一些帮助:developer.android.com/ndk/guides/cpp-support.html
-
只是想运行简单的helloworld示例java调用c++
标签: android c++ android-ndk android-studio-2.0