建立签名的APK时,android studio中的gradle问题

时间:2020-09-01 18:59:27

标签: java android android-studio gradle

我正在尝试使用android studio为我的项目构建一个已签名的APK。我收到的错误:

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
    }
}
...

reports/lint-results-release-fatal.html中,出现以下错误:

enter image description here

From previous topic,我试图在gradle中添加以下代码:

configurations {
    all {
        exclude module: 'httpclient'
        exclude module: 'commons-logging'
    }
}

谁帮助解决了这个问题,但随后在运行时又遇到了另一个问题(运行应用程序时):

java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/commons/logging/LogFactory;

在线:

TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance().createRegistry();

randle文件如下:

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
    implementation 'com.google.android.material:material:1.2.0'

    implementation 'com.google.firebase:firebase-analytics:17.5.0'
    implementation 'com.google.firebase:firebase-core:17.5.0'
    implementation 'com.google.firebase:firebase-auth:19.3.2'
    implementation 'com.google.firebase:firebase-firestore:21.6.0'
    implementation 'com.google.firebase:firebase-database:19.4.0'
    implementation 'com.google.firebase:firebase-storage:19.2.0'
    implementation 'com.google.firebase:firebase-messaging:20.2.4'
    implementation 'com.firebaseui:firebase-ui-firestore:6.2.1'
    implementation 'com.firebaseui:firebase-ui-auth:6.2.1'

    implementation 'com.github.bumptech.glide:glide:4.9.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'

    implementation 'com.github.pchmn:MaterialChipsInput:1.0.8'
    implementation 'com.github.Plumillon:ChipView:1.2.0'
    implementation 'com.hbb20:ccp:2.4.0'

    implementation 'org.mnode.ical4j:ical4j:1.0.5'
    implementation 'backport-util-concurrent:backport-util-concurrent:3.1'
    implementation 'commons-codec:commons-codec:1.10'
    implementation 'commons-lang:commons-lang:2.6'
    implementation 'com.linkedin.android.tachyon:tachyon:1.0.2'
}

可能是什么问题?我真的更喜欢解决问题,而不是忽略它。

1 个答案:

答案 0 :(得分:0)

我遇到了同样的问题,并使用此youtube帮助器进行了解决。

reference video link

  1. 转到buil.gradle(模块:应用)

  2. 在“ compieSdkVersion”上方编写以下代码

    lintOptions {

    checkReleaseBuilds为假

    }

  3. 重新构建