Could not GET 'http://oss.jfrog.org/artifactory/oss-snapshot-local/com/tencent/mm/AndResGuard-gradle-plugin/1.2.1/AndResGuard-gradle-plugin-1.2.1.pom'. Received status code 409 from server: Conflict Enable Gradle 'offline mode' and sync project
//资源文件混淆压缩classpath 'com.tencent.mm:AndResGuard-gradle-plugin:1.2.1'
apply plugin: 'AndResGuard'//资源文件混淆压缩
andResGuard {
//mappingFile = file("./resource_mapping.txt")
mappingFile = null
// 当你使用v2签名的时候,7zip压缩是无法生效的。
use7zip = true
useSign = true
// 打开这个开关,会keep住所有资源的原始路径,只混淆资源的名字
keepRoot = true
whiteList = [
// for your icon
"R.drawable.icon",
// for fabric
"R.string.com.crashlytics.*",
// for umeng update
"R.string.umeng*",
"R.string.UM*",
"R.string.tb_*",
"R.layout.umeng*",
"R.layout.tb_*",
//=========↓↓美洽↓↓=========
"R.layout.mq_*",
"R.drawable.mq_*",
"R.style.mq_*",
"R.string.mq_*",
"R.color.mq_*",
//=========↑↑美洽↑↑=========
//=========↓↓ping++↓↓=========
"R.layout.*pingpp*",
"R.drawable.pingpp*",
"R.drawable.tips_bg.9.png",
"R.style.*pingpp*",
"R.string.*pingpp*",
"R.id.pingpp*",
"R.color.*pingpp*",
//=========↑↑ping++↑↑=========
"R.drawable.umeng*",
"R.drawable.tb_*",
"R.anim.umeng*",
"R.color.umeng*",
"R.color.tb_*",
"R.style.*UM*",
"R.style.umeng*",
"R.id.umeng*",
// umeng share for sina
"R.drawable.sina*",
// for google-services.json
"R.string.google_app_id",
"R.string.gcm_defaultSenderId",
"R.string.default_web_client_id",
"R.string.ga_trackingId",
"R.string.firebase_database_url",
"R.string.google_api_key",
"R.string.google_crash_reporting_api_key",
// umeng share for facebook
"R.layout.*facebook*",
"R.id.*facebook*",
// umeng share for messager
"R.layout.*messager*",
"R.id.*messager*",
// umeng share commond
"R.id.progress_bar_parent",
"R.id.webView"
]
compressFilePattern = [
"*.png",
"*.jpg",
"*.jpeg",
"*.gif",
"resources.arsc"
]
sevenzip {
artifact = 'com.tencent.mm:SevenZip:1.2.1'
//path = "/usr/local/bin/7za"
}
}
//原先的插件版本 classpath 'com.android.tools.build:gradle:2.3.3' //更改后的插件版本 classpath 'com.android.tools.build:gradle:3.0.0'
//原先的插件版本 distributionUrl=https://services.gradle.org/distributions/gradle-3.3-all.zip //更改后的插件版本 distributionUrl=https://services.gradle.org/distributions/gradle-4.1-all.zip
Cannot set the value of read-only property 'outputFile' for ApkVariantOutputImpl_Decorated{apkData=Main{type=MAIN, fullName=tiger8shopDebug, filters=[]}} of type com.android.build.gradle.internal.api.ApkVariantOutputImpl. Open File
static def releaseTime() {
return new Date().format("yyyy-MM-dd-HH-mm", TimeZone.getDefault())//包含时分秒
}
static def debugTime() {
// return new Date().format("yyyy-MM-dd", TimeZone.getDefault())
return new Date().format("yyyy", TimeZone.getDefault())
}
//=============================上面的代码定义在android节点外,AS3.0版本如果需要输出apk文件名带上时间,上面代码你可以参考下===================================
//文件输出名增加版本号和时间
applicationVariants.all { variant ->
variant.outputs.each { output ->
def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith('.apk')) {
def fileName
if (outputFile.name.contains("debug")) {//debug版本,使用自己的文件名,方便记忆
fileName = "$applicationId _v${defaultConfig.versionName}_${debugTime()}_code${defaultConfig.versionCode}_debug.apk"
output.outputFile = new File(outputFile.parent, fileName)//Open File后定位到这个位置,这个配置,识别不出outputFile是啥了
} else {
fileName = "$applicationId _v${defaultConfig.versionName}_code${defaultConfig.versionCode}_${releaseTime()}_${variant.productFlavors[0].name}_release.apk"
output.outputFile = new File(outputFile.parent, fileName)
}
}
}
}
//AS3.0版本
android.applicationVariants.all { variant ->
variant.outputs.all {
if (variant.name.endsWith("Debug")) {
//debug包
outputFileName = "$applicationId _v${defaultConfig.versionName}_${debugTime()}_code${defaultConfig.versionCode}_debug.apk"
} else {
//release包
outputFileName = "$applicationId _v${defaultConfig.versionName}_code${defaultConfig.versionCode}_${releaseTime()}_release.apk"
}
}
}
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
apply plugin: 'android-apt'
//替换之前 apt "com.jakewharton:butterknife-compiler:$rootProject.ext.globalButterKnifeAptVersion" //替换之后 annotationProcessor "com.jakewharton:butterknife-compiler:$rootProject.ext.globalButterKnifeAptVersion"
repositories { google()//新增的 jcenter()}
Warning:One of the plugins you are using supports Java 8 language features. To try the support built into the Android plugin, remove the following from your build.gradle: apply plugin: 'me.tatarka.retrolambda' To learn more, go to https://d.android.com/r/tools/java-8-support-message.html
classpath 'me.tatarka:gradle-retrolambda:3.2.0'//lambda表达式
apply plugin: 'me.tatarka.retrolambda'//lambda表达式
Error:All flavors must now belong to a named flavor dimension. Learn more at https://d.android.com/r/tools/flavorDimensions-missing-error-message.html
//之前的配置
productFlavors {
_360 {}
baidu {}
xiaomi {}
meizu {}
tencent {}
}
productFlavors.all { flavor ->
flavor.manifestPlaceholders = [CLICK_CHANNEL_VALUE: name]
}
// ==============================分割线===================================
//改成如下配置,问题解决
flavorDimensions "tier"//新增的,值是数组
productFlavors {
_360 { dimension "tier"}
baidu { dimension "tier"}
xiaomi { dimension "tier"}
meizu { dimension "tier"}
tencent { dimension "tier"}
}
productFlavors.all { flavor ->
flavor.manifestPlaceholders = [CLICK_CHANNEL_VALUE: name]
}
android.enableAapt2=false
compileSdkVersion = 26
apply plugin: 'robust'//美团热更新框架
//美团热更新框架 compile "com.meituan.robust:robust:${ROBUST_VERSION}"
buildscript {
repositories {
...
google()
}
}
dependencies {
api fileTree(include: ['*.jar'], dir: 'libs')
api 'com.squareup.okhttp3:okhttp:3.4.2'
...
debugApi 'com.squareup.leakcanary:leakcanary-android:1.5.1'
releaseApi 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
}
//apply plugin: 'android-apt'
dependencies {
...
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
}
buildscript {
...
dependencies {
...
//classpath 'me.tatarka:gradle-retrolambda:3.2.5'
}
}
apply plugin: 'robust'//美团热更新框架
//美团热更新框架
compile "com.meituan.robust:robust:${ROBUST_VERSION}"
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有