Android NDK - armeabi vs armeabi-v7a 文件夹 [英] Android NDK - armeabi vs armeabi-v7a folder

查看:34
本文介绍了Android NDK - armeabi vs armeabi-v7a 文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有些问题和我的一样.

为什么我需要将 *.so 文件同时放在 armeabi-v7a 和 armeabi 文件夹中?

为什么 armeabi-v7a 与其他模块的 armeabi 冲突?

为什么使用 armeabi-v7a 代码而不是 armeabi 代码?

但我还不清楚.我有很多 armeabi 和 armeabi-v7a 的 .so 文件.

But I am not clear yet. I have many .so files for armeabi and armeabi-v7a.

//二进制文件

armeabi/libarmeabi-v7a-module1.so
armeabi/libarmeabi-v7a-module2.so

//应用程序.mk文件

// Application.mk file

APP_ABI := armeabi
APP_PLATFORM := android-19
APP_STL := gnustl_shared

//Android.mk 文件

// Android.mk file

include $(CLEAR_VARS)
LOCAL_MODULE := module1
LOCAL_SRC_FILES := $(LOCAL_PATH)/armeabi/libarmeabi-v7a-module1.so
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := module2
LOCAL_SRC_FILES := $(LOCAL_PATH)/armeabi/libarmeabi-v7a-module2.so
include $(PREBUILT_SHARED_LIBRARY)

此设置在 armeabi-v7a 设备上运行良好.但是当我在 Application.mk 文件中设置 armeabi-v7a abi 时,我的应用程序崩溃了.崩溃消息如下:

This settings work fine on armeabi-v7a devices. But my app crashes when I set armeabi-v7a abi in Application.mk file. Crash message is below:

A/libc:/Volumes/Android/buildbot/src/android/ndk-release-r16/external/libcxx/../../external/libcxxabi/src/abort_message.cpp:73:abort_message:断言调用了纯虚函数!"失败

A/libc: /Volumes/Android/buildbot/src/android/ndk-release-r16/external/libcxx/../../external/libcxxabi/src/abort_message.cpp:73: abort_message: assertion "Pure virtual function called!" failed

推荐答案

armeabi 是 armv5.它不再受支持.你可以假装它不存在.

armeabi is armv5. It's no longer supported. You can just pretend it doesn't exist.

armeabi-v7a 是 armv7.这(至少与 arm64-v8a 一起)是您应该构建的内容.

armeabi-v7a is armv7. This (along with at least arm64-v8a) is what you should be building for.

您的应用程序崩溃是一个不同的问题,错误消息会告诉您发生了什么:正在调用一个纯虚函数.某些子类没有实现它需要实现的虚函数.

The fact that your app is crashing is a different problem, and the error message tells you what's happening: there's a pure virtual function that's being called. Some child class isn't implementing a virtual function that it needs to implement.

还有第三个问题.您的 APP_STLgnustl_shared,但错误消息表明您的库之一是用 libc++ 构建的.这两者是不相容的.您必须为整个应用程序使用相同的 STL(并且由于您使用了多个共享库,因此它必须是共享变体).

There's also a third problem. Your APP_STL is gnustl_shared, but the error message indicates that one of your libraries was built with libc++. These two are incompatible. You must use the same STL for the entire app (and since you use more than one shared library, it must be the shared variant).

这篇关于Android NDK - armeabi vs armeabi-v7a 文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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