gpt4 book ai didi

android - 应用程序在模拟器上运行良好,但在设备上崩溃并出现 : java. lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__aeabi_memcpy"

转载 作者:行者123 更新时间:2023-11-30 05:09:06 29 4
gpt4 key购买 nike

我正在尝试实现 yctung 的 AndroidLibSvm使用 Android Studio 3.2.1 进入我的项目。虽然该应用程序在任何模拟设备上都能正常运行(我尝试过 Android 23 和 28,两者都运行得很好),但它在我的真实设备(装有 Android 6.0 的联想平板电脑)上崩溃并出现以下错误:

java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__aeabi_memcpy" referenced by "/data/app/com.krautkremer.nils.mymirror-2/lib/arm/libjnilibsvm.so"

一旦应用程序尝试运行使用 cytung 库的代码部分。SO 上有一些类似的案例,例如herehere但是设置我的

arguments "-DANDROID_PLATFORM=android-23"

或任何其他 android-x 和我在 build.gradle 中将 targetSdkVersion 设置为 23 都没有解决它。

这是我的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 ""
arguments "-DANDROID_PLATFORM=android-23"
}
}
}
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"


}
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.1.0-alpha01'
implementation 'androidx.media:media:1.1.0-alpha01'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha2'
implementation 'com.google.android.material:material:1.1.0-alpha01'
implementation 'androidx.annotation:annotation:1.0.1'
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.google.firebase:firebase-ml-vision:18.0.2'
implementation 'com.google.firebase:firebase-ml-common:16.1.6'
implementation 'com.google.firebase:firebase-ml-vision-face-model:17.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1-alpha01'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1-alpha01'
implementation project(':androidlibsvm-release')
}
apply plugin: 'com.google.gms.google-services'

我什至将我的 NDK 版本从 18 降级到 15,但没有成功。任何想法可能是什么问题?

Help me, Obi-Wan Kenobi. You're my only hope.

编辑:这是我的 CMakeLists.txt,如果有帮助的话。我没有改变任何东西,对吧?

# For more information about using CMake with Android Studio, read the
# documentation: https://d.android.com/studio/projects/add-native-code.html

# Sets the minimum version of CMake required to build the native library.

cmake_minimum_required(VERSION 3.4.1)

# Creates and names a library, sets it as either STATIC
# or SHARED, and provides the relative paths to its source code.
# You can define multiple libraries, and CMake builds them for you.
# Gradle automatically packages shared libraries with your APK.

add_library( # Sets the name of the library.
native-lib

# Sets the library as a shared library.
SHARED

# Provides a relative path to your source file(s).
src/main/cpp/native-lib.cpp)

# Searches for a specified prebuilt library and stores the path as a
# variable. Because CMake includes system libraries in the search path by
# default, you only need to specify the name of the public NDK library
# you want to add. CMake verifies that the library exists before
# completing its build.

find_library( # Sets the name of the path variable.
log-lib

# Specifies the name of the NDK library that
# you want CMake to locate.
log)

# Specifies libraries CMake should link to your target library. You
# can link multiple libraries, such as libraries you define in this
# build script, prebuilt third-party libraries, or system libraries.

target_link_libraries( # Specifies the target library.
native-lib

# Links the target library to the log library
# included in the NDK.
${log-lib})

最佳答案

尝试更改您的minSdkVersiontargetSdkVersion,即

minSdkVersion 15
targetSdkVersion 23

关于android - 应用程序在模拟器上运行良好,但在设备上崩溃并出现 : java. lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__aeabi_memcpy",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54013811/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com