介绍
Android studio插件,检查依赖的so是否支持64位(或者其他的abi)
源码链接
软件架构
apk构建的过程中,会执行{merge[BuildVariants]NativeLibs}这个task去合并所有的依赖,包括lib下的依赖以及远程依赖,通过遍历这个task的输入文件,读取对应文件夹下的so文件并比较;
并且,通过dependencyInsight,我们可以查找到这个so文件最顶层的依赖。
安装教程
- 在根目录下的build.gradle中添加
repositories {
maven {url 'https://gitee.com/kuangxuefeng/MeavenPrivate/raw/dev20200727/CheckApkSoPlugin/'}
}
dependencies {
classpath "com.kxf.checkapksoplugin:CheckApkSoPlugin:0.0.1.alpha"
}
allprojects {
repositories {
maven {url 'https://gitee.com/kuangxuefeng/MeavenPrivate/raw/dev20200727/CheckApkSoPlugin/'}
}
}
- 在moudle的build.gradle中添加
apply plugin: 'com.kxf.checkapksoplugin.CheckApkSoPlugin'
- 在moudle的build.gradle中添加配置参数(可选)
kxf_CheckApkSoPlugin{
ABI_TYPES = ["armeabi-v7a", "arm64-v8a"]
}
使用说明
-
在task列表中找到CheckApkSoPlugin,属于分组kxf,找到后执行 -
看见success后表示执行成功 > Task :testcheckso:CheckApkSoPlugin
kxf => CheckApkSoPlugin start.
==============success==============
so file in armeabi-v7a but not in arm64-v8a:
(pomName=jetified-soaartest-1.0.0.1, soName=libsoaartest.so, soPath=/Users/xuefeng.kuang/.gradle/caches/transforms-3/075e2ee49f1b20eba629c06676b97cd4/transformed/jetified-soaartest-1.0.0.1/jni/armeabi-v7a/libsoaartest.so, dependencyInfo=null)
(pomName=jetified-solibtest-1.0.0.1, soName=libsolibtest.so, soPath=/Users/xuefeng.kuang/.gradle/caches/transforms-3/f68aa37fa76b1b94707c44c2209eab12/transformed/jetified-solibtest-1.0.0.1/jni/armeabi-v7a/libsolibtest.so, dependencyInfo=com.kxf.aarssotest:aarssotest:1.0.0.1)
so file in arm64-v8a but not in armeabi-v7a:
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.8/userguide/command_line_interface.html
BUILD SUCCESSFUL in 32s
5 actionable tasks: 2 executed, 3 up-to-date
10:35:14: Task execution finished 'CheckApkSoPlugin'.
-
执行log中会输出缺少的so文件,dependencyInfo为依赖关系
特技
qq联系:1024883177
|