lintOptions

android {
    lintOptions {
        // true--关闭lint报告的分析进度
        quiet true
        // true--错误发生后停止gradle构建
        abortOnError false
        // true--只报告error
        ignoreWarnings true
        // true--忽略有错误的文件的全/绝对路径(默认是true)
        //absolutePaths true
        // true--检查所有问题点,包含其他默认关闭项
        checkAllWarnings true
        // true--所有warning当做error
        warningsAsErrors true
        // 关闭指定问题检查
        disable 'TypographyFractions','TypographyQuotes'
        // 打开指定问题检查
        enable 'RtlHardcoded','RtlCompat', 'RtlEnabled'
        // 仅检查指定问题
        check 'NewApi', 'InlinedApi'
        // true--error输出文件不包含源码行号
        noLines true
        // true--显示错误的所有发生位置,不截取
        showAll true
        // 回退lint设置(默认规则)
        lintConfig file("default-lint.xml")
        // true--生成txt格式报告(默认false)
        textReport true
        // 重定向输出;可以是文件或'stdout'
        textOutput 'stdout'
        // true--生成XML格式报告
        xmlReport false
        // 指定xml报告文档(默认lint-results.xml)
        xmlOutput file("lint-report.xml")
        // true--生成HTML报告(带问题解释,源码位置,等)
        htmlReport true
        // html报告可选路径(构建器默认是lint-results.html )
        htmlOutput file("lint-report.html")
        //  true--所有正式版构建执行规则生成崩溃的lint检查,如果有崩溃问题将停止构建
        checkReleaseBuilds true
        // 在发布版本编译时检查(即使不包含**重点内容**lint目标),指定问题的规则生成崩溃
        fatal 'NewApi', 'InlineApi'
        // 指定问题的规则生成错误
        error 'Wakelock', 'TextViewEdits'
        // 指定问题的规则生成警告
        warning 'ResourceAsColor'
        // 忽略指定问题的规则(同关闭检查)
        ignore 'TypographyQuotes'
    }
}
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
我jdk版本是11.0.13,以下是我gradle的代码android { lintOptions { checkReleaseBuilds false // Or, if you prefer, you can continue to check for errors in release builds, // but continue the build even when errors are found: abortOnError false } signingConfigs { debug { storePassword '123456' keyAlias = 'screen2' keyPassword '123456' storeFile file('O:\AvtronsysResoucres\code\Screenbox2-kasuo\app\screen2_android10.jks') } Release { storeFile file('O:\AvtronsysResoucres\code\Screenbox2-kasuo\app\screen2_android10.jks') storePassword '123456' keyPassword '123456' keyAlias = 'screen2' } } compileSdkVersion 29 defaultConfig { applicationId "com.avtronsys.screen2" minSdkVersion 21 targetSdkVersion 28 def code = new Date().format("yyMMddHHmm"); //versionName "V1.1_"+ versionCode versionCode 2112320000; versionName "V1.1_"+ code println "versionCode = "+versionCode println "versionName = "+(String)versionName testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" externalNativeBuild { cmake { abiFilters "armeabi-v7a" cppFlags "" } } ndk { abiFilters "armeabi-v7a" } } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' signingConfig signingConfigs.debug } } //externalNativeBuild { // cmake { // path "CMakeLists.txt" // } //} sourceSets { main { jni.srcDirs = [] jniLibs.srcDirs = ['libs'] } } compileOptions { sourceCompatibility = 1.8 targetCompatibility = 1.8 } //buildToolsVersion = '29.0.2' applicationVariants.all { variant -> variant.outputs.all { output -> def outputFile = output.outputFile def fileName if (outputFile != null && outputFile.name.endsWith('.apk')) { if (variant.buildType.name.equals('release')) { fileName = "Screen2_Release_${defaultConfig.versionName}.apk" } else if (variant.buildType.name.equals('debug')) { fileName = "Screen2_Debug_${defaultConfig.versionName}.apk" } outputFileName = fileName } } } },这样的配置还是会出现Unsupported class file major version 55,是哪里的问题
最新发布
06-13
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值