Android多渠道打包报错
在Android工程进行多渠道打包时,运行单个渠道的Gradle Task自动化打包时遇到如下错误
Execution failed for task ':app:lintVitalOssRelease'.
> Could not resolve all artifacts for configuration ':app:TESTReleaseRuntimeClasspath'.
> Failed to transform libs.jar to match attributes {artifactType=processed-jar, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
> Execution failed for JetifyTransform: /Users/lv/Downloads/flutter_workplace/pop_law_flutter/build/app/intermediates/flutter/TESTRelease/libs.jar.
> Transform's input file does not exist: /Users/lv/Downloads/flutter_workplace/pop_law_flutter/build/app/intermediates/flutter/TESTRelease/libs.jar. (See https://issuetracker.google.com/issues/158753935)
解决方案:
在build.gradle(:app)
中的android{}
目录下的lintOptions{}
中添加checkReleaseBuilds false
即:
android {
...
lintOptions {
...
//true--所有正式版构建执行规则生成崩溃的lint检查,如果有崩溃问题将停止构建
checkReleaseBuilds false
...
}
...
}
再次运行Gradle Task脚本,成功。