因此,我在android代码中使用C ++,但出现以下错误。
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.psyentificmind.baldi, PID: 6804
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.psyentificmind.baldi-2/base.apk"],nativeLibraryDirectories=[/data/app/com.psyentificmind.baldi-2/lib/x86, /system/lib, /vendor/lib]]] couldn't find "libBapi.so"
似乎我遇到了与this post完全相同的问题,但是我不确定compile for the correct architecture
的含义,如何在android studio中进行检查?我试图做abiFilters
,但这对我也不起作用。以下是我的网格文件:
build.gridle(模块1):
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "com.psyentificmind.baldi"
minSdkVersion 17
targetSdkVersion 27
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
splits {
abi {
enable true
reset()
include 'x86', 'armeabi'
universalApk true
}
}
}
dependencies {
implementation project(':androidBapi')
implementation 'com.android.support:support-v4:27.0.0'
build.gradle(第2单元)
apply plugin: 'com.android.library'
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
minSdkVersion 17
targetSdkVersion 27
ndk {
moduleName "libBapi"
}
}
sourceSets {
main {
jni.srcDirs = []
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
implementation 'com.android.support:support-v4:27.0.0'
implementation files('libs/eventbus-2.1.0-beta-1.jar')
implementation files('libs/svox_sofa_v101.jar')
}
这是我项目结构的picture。