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

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

问题描述

有一些像我这样的问题.

There are some questions like mine.

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

为什么armeabi-v7a与另一个模块的armeabi冲突?

为什么要在armeabi代码上使用armeabi-v7a代码?

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

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

//Application.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_STL gnustl_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天全站免登陆