удалить неиспользуемые файлы одной зависимости в android studio - PullRequest
0 голосов
/ 31 марта 2020

Я пытался:

1)

buildTypes {
    release {
        shrinkResources true
    }
}

2)

"Refactor" --> "Remove Unused Resources"

, но при этом удаляются только те ресурсы, которые я сам создал , я хочу удалить этот файл (globe.png), который добавлен зависимостью:

pic1

pic2

зависимость, которая добавила этот файл: 'com.github.blongho:worldCountryData:1.4' см. здесь

спасибо за вашу помощь❤️

1 Ответ

0 голосов
/ 31 марта 2020

Вам необходимо добавить minifyEnabled true, как показано ниже. shrinkResources учитывается только в том случае, если minifyEnabled является истинным, см. this

buildTypes {
    release {
        // Enables code shrinking, obfuscation, and optimization for only
        // your project's release build type.
        minifyEnabled true

        // Enables resource shrinking, which is performed by the
        // Android Gradle plugin.
        shrinkResources true

        // Includes the default ProGuard rules files that are packaged with
        // the Android Gradle plugin. To learn more, go to the section about
        // R8 configuration files.
        proguardFiles getDefaultProguardFile(
                'proguard-android-optimize.txt'),
                'proguard-rules.pro'
    }
}

См. this для получения более подробной информации

...