【问题标题】:NDK in Android Studio not working for C++ filesAndroid Studio 中的 NDK 不适用于 C++ 文件
【发布时间】: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


【解决方案1】:

由于我对 NDK 非常陌生,因此需要一些时间来弄清楚方法和选项。

这是我发现的两个非常好的页面,它们帮助解决了几乎所有的问题。并了解最新的 Android 工作室如何与 NDK 配合使用。

link 1 link 2

尽管我参考了上述页面,但我在 Android Studio 2.0 上尝试了 NDK,它工作正常。所以想分享相同的

【讨论】:

    猜你喜欢
    • 2014-03-30
    • 2018-05-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-09-17
    相关资源
    最近更新 更多