Проблемы с релизом apk для Android - PullRequest
0 голосов
/ 22 мая 2018

Я обновил свою Android-студию с 3.0.1 до 3.1.2 и мою версию Gradle с 4.1 до 4.4, каждый раз, когда это выходило, кроме выпуска подписанного APK, у меня всегда одни и те же проблемы

Не удалось выполнить задачу ': app: transformClassesAndResourcesWithProguardForRelease'.

Мой Gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion '26.0.3'

    defaultConfig {
        applicationId 'com.***.***'
        minSdkVersion 16
        targetSdkVersion 26 
        versionCode 3
        versionName "3.5.07.180521"
        multiDexEnabled true
        resValue("string", "PORT_NUMBER", "15711")
    }
    aaptOptions {
        additionalParameters "--no-version-vectors"
    }
    dexOptions {
        javaMaxHeapSize "4g"
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            android.applicationVariants.all { variant ->
                variant.outputs.all {
                    outputFileName = "qs_${variant.versionName}.apk"
                }
            }
        }

    }

    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
    }
    productFlavors {
    }
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/ASL2.0'
        exclude 'classes.dex'
    }
}

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

    implementation'com.google.firebase:firebase-messaging:11.8.0'
    implementation'com.google.firebase:firebase-appindexing:11.8.0'
    implementation'com.google.firebase:firebase-core:11.8.0'
    implementation'com.android.support:multidex:1.0.0'
    implementation'com.android.support.constraint:constraint-layout:1.0.2'
    implementation project(path: ':quayosolution')
}


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

Мой файл журнала во время создания подписанного APK можно найти ЗДЕСЬ , но конецlog

Warning: there were 779 unresolved references to classes or interfaces.
         You may need to add missing library jars or update their versions.
         If your code works fine without the missing classes, you can suppress
         the warnings with '-dontwarn' options.
         (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)
Warning: there were 68 instances of library classes depending on program classes.
         You must avoid such dependencies, since the program classes will
         be processed, while the library classes will remain unchanged.
         (http://proguard.sourceforge.net/manual/troubleshooting.html#dependency)
Warning: there were 6 unresolved references to program class members.
         Your input classes appear to be inconsistent.
         You may need to recompile the code.
         (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedprogramclassmember)
Warning: there were 2 unresolved references to library class members.
         You probably need to update the library versions.
         (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedlibraryclassmember)
Warning: Exception while processing task java.io.IOException: Please correct the above warnings first.
:app:transformClassesAndResourcesWithProguardForRelease FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
> Job failed, see logs for details

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 7s
40 actionable tasks: 2 executed, 38 up-to-date

Я пытался добавить

-dontwarn к моему proguard-rules.pro, но ничего не изменилось.

ПРИМЕЧАНИЕ: imвозможность генерировать APK, если для minifyEnabled установлено значение false, но размер APK больше ожидаемого.

...