Android Gradle Error: Could not find method jniLibs() for PackagingOptions
The error message 'Could not find method jniLibs() for arguments [build_195zezm53jh2k90zcm89f18cc$_run_closure2$_closure6$_closure11@1d1cda72] on object of type com.android.build.gradle.internal.dsl.PackagingOptions' suggests you are attempting to use the jniLibs() method on an object that doesn't support it. The jniLibs() method is typically used in the android block of your Gradle build script, specifically within the defaultConfig or buildTypes sections, to specify the location of your native libraries.
To resolve this issue, ensure you are using the jniLibs() method in the correct location. Here's an example of how it should be used:
android {
// ...
defaultConfig {
// ...
jniLibs.srcDirs = ['src/main/jniLibs']
}
// ...
}
Make sure you are using this code within the android block, and specifically within the defaultConfig or buildTypes sections.
原文地址: https://www.cveoy.top/t/topic/pd7F 著作权归作者所有。请勿转载和采集!