生成签名APK时出错

时间:2018-04-08 13:22:07

标签: java android android-studio

所以,每当我尝试生成一个签名的apk时,这个错误就会出现,它不会让我完成生成签名的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
    } }

...

以下是 app gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.gmail.andre00nogueira.feelproject"
        minSdkVersion 21
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        renderscriptTargetApi 24
        renderscriptSupportModeEnabled true

    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    } }

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    compile 'com.squareup.okhttp:okhttp:2.3.0'
    compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.wonderkiln:blurkit:1.0.0'
    compile 'com.android.support:design:26.1.0'
    compile 'com.google.firebase:firebase-core:12.0.0'

} apply plugin: 'com.google.gms.google-services'

这是项目gradle

 // Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.0'
        classpath 'com.google.gms:google-services:3.2.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    } }

allprojects {
    repositories {
        google()
        jcenter()
    } }

task clean(type: Delete) {
    delete rootProject.buildDir }

2 个答案:

答案 0 :(得分:0)

在android {}

中的app gradle中尝试此操作
lintOptions { 
    checkReleaseBuilds false
}

答案 1 :(得分:0)

这通常与您用于生成已签名APK的方法有关,如果您使用其他方法生成已签名的APK,则您将能够生成已签名的APK。 希望它有所帮助,祝你好运!