当前位置:   article > 正文

org.gradle.api.GradleException: Lint found fatal errors while assembling a release target_caused by: org.gradle.api.gradleexception: lint fo

caused by: org.gradle.api.gradleexception: lint found fatal errors while ass

问题描述:

Caused by: org.gradle.api.GradleException: Lint found fatal errors while assembling a release target.

To proceed, either fix the issues identified by lint, or modify your build script as follows:
...
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
    }
}

解决方案:

修改上图中的build.gradle,添加如下代码:

  1. lintOptions {
  2. checkReleaseBuilds false
  3. abortOnError false
  4. }

修改后的build.gradle如下图所示:

  1. apply plugin: 'com.android.application'
  2. android {
  3. compileSdkVersion 26
  4. defaultConfig {
  5. applicationId "app.kenong.com.hbknclient"
  6. minSdkVersion 15
  7. targetSdkVersion 26
  8. versionCode 1
  9. versionName "1.0"
  10. testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  11. }
  12. buildTypes {
  13. release {
  14. minifyEnabled false
  15. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  16. }
  17. }
  18. packagingOptions {
  19. exclude 'META-INF/DEPENDENCIES'
  20. }
  21. //添加如下配置
  22. lintOptions {
  23. checkReleaseBuilds false
  24. abortOnError false
  25. }
  26. }
  27. dependencies {
  28. implementation fileTree(include: ['*.jar'], dir: 'libs')
  29. implementation 'com.android.support:appcompat-v7:26.1.0'
  30. implementation 'com.android.support.constraint:constraint-layout:1.0.2'
  31. implementation 'com.android.support:design:26.1.0'
  32. testImplementation 'junit:junit:4.12'
  33. androidTestImplementation 'com.android.support.test:runner:1.0.1'
  34. androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
  35. implementation files('libs/zxing.jar')
  36. implementation files('libs/httpcore-4.4.6.jar')
  37. implementation files('libs/httpclient-4.5.3.jar')
  38. implementation 'com.android.support:cardview-v7:26.1.0'
  39. implementation files('libs/fastjson-1.2.33.jar')
  40. implementation files('libs/commons-logging-1.2.jar')
  41. implementation files('libs/json-lib-2.4-jdk15.jar')
  42. }

 

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/485025
推荐阅读
相关标签
  

闽ICP备14008679号