Android 为不同的体系结构编译本机代码(以减小大小)

Android 为不同的体系结构编译本机代码(以减小大小),android,eclipse,android-ndk,Android,Eclipse,Android Ndk,我在Android应用程序中使用了一个本机库。libs文件夹中有4个.so文件(armeabi、armeabi-v7a、mips、x86)。现在,问题是,每个.so文件都接近10MB。这使得apk的总大小大约为40MB。我只想为相关架构包含一个.so文件,而不包含其他.so文件 这是我的应用程序。mk: # When we build for google play, we build 4 different apk's, each with # a different version, by

我在Android应用程序中使用了一个本机库。libs文件夹中有4个.so文件(armeabi、armeabi-v7a、mips、x86)。现在,问题是,每个.so文件都接近10MB。这使得apk的总大小大约为40MB。我只想为相关架构包含一个.so文件,而不包含其他.so文件

这是我的应用程序。mk:

# When we build for google play, we build 4 different apk's, each with
# a different version, by uncommenting one of the pairs of lines below.
# Suppose our base version is X:

# Version X: armeabi
#APP_PLATFORM=android-8
#APP_ABI := armeabi

# Version X+1: armeabi-v7a (Much faster due to the availability of hardware
# FP, but cannot be run in the emulator).
APP_PLATFORM=android-8
APP_ABI := armeabi

# Version X+2: x86 (Requires android-9, so a change needs to be made in
# AndroidManifest.xml too)
#APP_PLATFORM=android-9
#APP_ABI := x86

# Version X+3: mips (Requires android-9, so a change needs to be made in
# AndroidManifest.xml too)
#APP_PLATFORM=android-9
#APP_ABI := mips

ifdef NDK_PROFILER
# The profiler doesn't seem to receive ticks when run on release code.
# Accordingly, we need to build as debug - but this turns optimisations
# off, which is less than ideal.
APP_OPTIM := debug
APP_CFLAGS := -O2
else
APP_OPTIM := release
endif
ifdef V8_BUILD
APP_STL := stlport_static
endif
ifdef MEMENTO
APP_CFLAGS += -DMEMENTO -DMEMENTO_LEAKONLY
endif

# If the ndk is r8b then workaround bug by uncommenting the following line
#NDK_TOOLCHAIN_VERSION=4.4.3

# If the ndk is newer than r8c, try using clang.
#NDK_TOOLCHAIN_VERSION=clang3.1
我是ndk的新手,所以我可能会在某个地方出错,但我有一种预感,这个Application.mk根本不会被执行。我如何让它运行?因为即使存在APP_ABI:=armeabi,我也会在编译的apk(使用winrar打开)中获得所有的.so文件

我的问题是,我如何告诉.mk为特定的体系结构构建?我的变化将如何反映?我只需单击RUN(eclipse中的绿色三角形)

附言:
这是我下载的第三方库,因此我不知道其中的代码

可能重复的代码。有人能回答我的问题吗?是否可以在发布前物理删除.so文件?或者这会把事情搞砸吗?确保你的Application.mk在jni文件夹中;在Linux上,检查它是否以大写字母“A”开头。我刚刚意识到我甚至还没有填ndk。您能告诉我是否可以删除。所以在发布之前不需要这样做吗?您可以删除eclipse项目的libs文件夹中的库。