我正在尝试使用JNI在Android上编译Crypto ++库。我已经克隆了https://github.com/morgwai/ndktutorial项目。我将项目导入android studio,可以调用JNI类并读取Crypto ++,但是当调用该库时,出现内部错误,提示“内存”,没有指向#include <memory>
的文件或目录。
这是我的build.gradle:
apply plugin: 'com.android.model.application'
model {
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.moham.myapplication"
minSdkVersion.apiLevel 22
targetSdkVersion.apiLevel 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles.add(file('proguard-android.txt'))
}
}
ndk {
moduleName "crypt_user.cpp"
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.1'
}
这也是我编译时遇到的错误:
MYPATH\Android\sdk\ndk-bundle\platforms\android-23\arch-arm64\usr\include\stdcpp.h
Error:(10, 18) memory: No such file or directory
compilation terminated.
Error:Execution failed for task ':app:compileCrypt_userArm64-v8aDebugSharedLibra
ryCrypt_userMainCpp'.
> A build operation failed.
C++ compiler failed while compiling crypt_user.cpp.
See the complete log at: file:///D:/MyApplication/app/build/tmp/compileCrypt_u
serArm64-v8aDebugSharedLibraryCrypt_userMainCpp/output.txt
先感谢您。
最佳答案
加
APP_STL = c++_shared
到您的Application.mk
关于android - 错误:<内存>在具有JNI的Android上没有此类文件或目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40047190/