更新AS出错,unknown property 'outputScope'
KingBillSame opened this issue · 1 comments
KingBillSame commented
Android Grade Plugin Version :4.0.0
Grade Version :6.4.1
报错:
Gradle sync failed: Could not get unknown property 'outputScope' for task ':limpid:packageDebug' of type com.android.build.gradle.tasks.PackageApplication.
定位在build.grade第34行 variant.getPackageApplicationProvider().get().outputScope.apkDatas.forEach { apkData ->
如下:
buildTypes {
release {
shrinkResources false // Keep false, or icons in /drawable-nodpi/ will become black.
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
// For formatting apk file name, like com.by_syk.template_v1.0.0(17012500).apk
applicationVariants.all { variant ->
if (variant.buildType.name != "debug") {
variant.getPackageApplicationProvider().get().outputDirectory = new File(project.rootDir.absolutePath + "/limpid/release")
}
variant.getPackageApplicationProvider().get().outputScope.apkDatas.forEach { apkData ->
apkData.outputFileName = ((project.name != "app") ? project.name : rootProject.name) + "-" +
variant.versionName +
".apk"
}
}
}
}
KingBillSame commented
我自己解决了。
https://blog.csdn.net/shinnexi/article/details/102610270
有一说一这个模板基本上每次升级AS和grade都报错,哎其实真的是个不错的模板怎么就停更了。好在东搜搜西搜搜,我一个不懂代码的也补全这个模板了