java - 构建签名APK时android studio中的gradle问题

标签 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();
Grandle 文件如下所示:
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'
}
可能是什么问题?我真的更喜欢解决这个问题,而不是忽略它。

最佳答案

我遇到了同样的问题,并用这个 youtube 助手解决了它。
reference video link

  • 转到buil.gradle(模块:app)
  • 在“compieSdkVersion”上方写下代码
    lintOptions{
    checkReleaseBuilds 错误
    }
  • 再次构建
  • 关于java - 构建签名APK时android studio中的gradle问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63693854/

    相关文章:

    android - 如何在 Android Studio 中构建 AOSP 项目

    android-studio - 将函数名称作为字符串给出时如何调用 kotlin 函数?

    android - 原因:无效的区 block 类型[Android]

    java - Spock 单元测试,常规左移赋值抛出 SpockExecutionException : Data provider has no data

    java - fireTableRowsInserted( int , int ) 不起作用(需要重新打开 GUI)

    Android为按钮添加边框而不丢失 Material 主题(使用drawable)

    android - 在服务器端 jsp 接受来自 android 的请求

    java - SQLite 或数组列表

    java - 实现类,等腰三角形

    android - 运行时水平和垂直 ScrollView