Created
March 20, 2019 10:35
-
-
Save YeJiashen/354e7dfd214c8213a7ab123bfeece125 to your computer and use it in GitHub Desktop.
缺少某些架构的so库但是强行生成对应架构的apk防止安装包错的方法
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ext.abiCodes = ['arm64-v8a':2, armeabi:3, 'armeabi-v7a':4, mips:5, mips64:6, x86:7, 'x86_64':8] | |
android { | |
splits { | |
abi { | |
enable true | |
universalApk true | |
} | |
} | |
applicationVariants.all { variant -> | |
variant.outputs.each { output -> | |
def abiVersionCode = | |
project.ext.abiCodes.get(output.getFilter("ABI")) | |
if (abiVersionCode != null) { | |
output.versionCodeOverride = abiVersionCode | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment