赞
踩
android studio 引用aar的时候,一般需要将aar文件放在libs目录下,并同步修改build.gradle文件
- dependencies {
- implementation fileTree(dir: "libs", include: ["*.jar","*.aar"])
- }
如若aar中存在so文件,但我们为了减少apk 大小,仅仅想其中几种abi,而非所有abis,可在
build.gradle中做如下配置:
- packagingOptions {
- exclude 'lib/arm64-v8a/libcrashlytics-envelope.so'
- exclude 'lib/arm64-v8a/libcrashlytics.so'
- exclude 'lib/armeabi/libcrashlytics-envelope.so'
- exclude 'lib/armeabi/libcrashlytics.so'
- exclude 'lib/mips64/libcrashlytics-envelope.so'
- exclude 'lib/mips64/libcrashlytics.so'
- exclude 'lib/mips/libcrashlytics-envelope.so'
- exclude 'lib/mips/libcrashlytics.so'
- exclude 'lib/x86_64/libcrashlytics-envelope.so'
- exclude 'lib/x86_64/libcrashlytics.so'
- }
如此,将不需要的abi exclude掉,在一定程度上可为 apk瘦身。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。