提问人:Pp1 提问时间:11/14/2023 更新时间:11/14/2023 访问量:30
有人知道为什么我无法加载我的本机库吗?
Anyone know why i can't load my native libraries?
问:
plugins {
id("com.android.library") version "7.2.2"
kotlin("android") version "1.5.21"
}
dependencies {
testImplementation("junit:junit:4.13.2")
testImplementation("org.junit.vintage:junit-vintage-engine:5.10.0")
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.6.21")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21")
}
@Suppress("UnstableApiUsage")
android {
namespace = "com.aptiv.acf.testinterfaces"
compileSdk = 31
ndkVersion = "21.4.7075529"
defaultConfig {
minSdk = 28
targetSdk = 31
externalNativeBuild {
cmake {
targets += "MyLibs1_jni"
targets += "MyLibs2_jni"
targets += "MyLibs3_jni"
}
}
}
externalNativeBuild {
cmake {
path = project.file("cmakelists/gradle/CMakeLists.txt")
version = "3.19.0+"
}
}
packagingOptions {
resources.excludes.add("META-INF/*")
}
}
当我在stackOverFlow中搜索时,人们正在谈论这段代码,但我什至不能使用它:
sourceSets.main
{
jni.srcDirs = [] // ndk-build.cmd needs to be invoked from command line
jniLibs.srcDirs '/src/main/libs'
}
我的库与文件夹 libs(*so 文件)中的 build.gradle 在同一个包中,我需要帮助,如果有人有任何想法,我将不胜感激,谢谢
答: 暂无答案
评论