如何在Application.mk中设置APP-PLATFORM以匹配Android Studio 3.2.1中的targetSDKVersion [英] How do I set the APP-PLATFORM in Application.mk to match the targetSDKVersion in Android Studio 3.2.1

查看:325
本文介绍了如何在Application.mk中设置APP-PLATFORM以匹配Android Studio 3.2.1中的targetSDKVersion的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将 YCTung的AndroidLibSVM 导入到我的项目中,但是当我运行代码时在我的Android 6.0.1平板电脑上,出现此错误:

I'm trying to import Y.C.Tung's AndroidLibSVM into my project, but when i run the code on my Android 6.0.1 Tablet, i get this error:

java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__aeabi_memcpy"

根据此帖子这一个,可以通过升级APP来修复错误NDK的 application.mk /

According to this post or this one among a few others, the error can be fixed by upgrading the APP-PLATFORM in the NDK's application.mk/android.mk to match the targetSDKversion of the applikation. However, i cannot find these .mk files. They should be

在项目的jni/目录的子目录中",

"in a subdirectory of your project's jni/ directory",

但是我也不知道那在哪里.这是我的build.gradle:

but I don't know where that is as well. This is my build.gradle:

apply plugin: 'com.android.application'

android {
compileSdkVersion 28
defaultConfig {
    applicationId "com.krautkremer.nils.mymirror"
    minSdkVersion 23
    targetSdkVersion 28
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    externalNativeBuild {
        cmake {
            cppFlags ""
        }
    }
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
packagingOptions {
    exclude 'META-INF/proguard/androidx-annotations.pro'
}

externalNativeBuild {
    cmake {
        path "CMakeLists.txt"
    }
}

}

我对NDK不太了解,我对Java/Android/Android Studio/Gradle还是很陌生.感谢帮助!

I don't know much about the NDK and i'm quite new to Java/Android/Android Studio/Gradle. Appreciate the help!

推荐答案

您没有.您的NDK API版本需要与您的minSdkVersion相匹配.不保证您的应用程序可以在低于NDK API版本的任何版本上运行. externalNativeBuild自动处理此问题.如果需要将API 28用于NDK库,则需要将minSdkVersion设置为28.

You don't. You NDK API version needs to match your minSdkVersion. You app is not guaranteed to run on any release lower than your NDK API version. externalNativeBuild handles this automatically. If you need to use API 28 for your NDK libraries, you need to set your minSdkVersion to 28.

但是,我认为这不是问题所在.在过去的两周中,这个问题已经出现了三遍.看起来AndroidLibSVM是针对android-24或更高版本构建的.因此,它不能在该API级别之前的设备上使用(所有其他问题都在android-23上尝试使用它).

However, I don't think that's the problem here. This question has come up three times in the last two weeks. It looks like AndroidLibSVM was built against android-24 or higher. As such, it cannot be used on devices older than that API level (all the other questions were trying to use it on android-23).

这篇关于如何在Application.mk中设置APP-PLATFORM以匹配Android Studio 3.2.1中的targetSDKVersion的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆