我有一个来自供应商的 .so 文件,它只支持“arm”。目前它非常适合我的 Android 应用程序。不知何故,我想使用 Android Studio 模块分离实现,因此我可以按照本教程https://www.youtube.com/watch?v=1i4I-Nph-Cw将模块导出为 Jar 。
当我导出 JAR 时,构建过程返回错误
/Users/zoom/android-ndk-r9d/toolchains/mipsel-linux-android-4.8/prebuilt/darwin-x86_64/bin/../lib/gcc/mipsel-linux-android/4.8/../../../../mipsel-linux-android/bin/ld: skipping incompatible src/main/jniLibs/armeabi/libremote_client.so when searching for -lremote_client
/Users/zoom/android-ndk-r9d/toolchains/mipsel-linux-android-4.8/prebuilt/darwin-x86_64/bin/../lib/gcc/mipsel-linux-android/4.8/../../../../mipsel-linux-android/bin/ld: cannot find -lremote_client
collect2: error: ld returned 1 exit status
:app:linkMipsDebugRemoteDesktopSharedLibrary FAILED
FAILURE: Build failed with an exception.
Run Code Online (Sandbox Code Playgroud)
日志说 gradle 试图针对 mips 进行构建,但由于库不兼容而失败,因为我只有 arm 库。我的问题是如何跳过针对 mips 的构建过程?或者是否可以仅针对 ARM 架构?
构建.gradle
apply plugin: 'com.android.model.library'
model {
android {
compileSdkVersion = 23
buildToolsVersion = "22.0.1"
defaultConfig.with {
//applicationId = "com.test.remote"
minSdkVersion.apiLevel = 19
targetSdkVersion.apiLevel = 21
//versionCode = …Run Code Online (Sandbox Code Playgroud) android android-ndk android-gradle-plugin gradle-experimental