How to use the ProGuard in Android Studio?

后端 未结 6 1832
独厮守ぢ
独厮守ぢ 2020-11-28 19:07

This is my first project in Android Studio, and the code of my apps are not obfuscated. Im using this configuration in build.gradle file:

6条回答
  •  隐瞒了意图╮
    2020-11-28 19:42

    Try renaming your 'proguard-rules.txt' file to 'proguard-android.txt' and remove the reference to 'proguard-rules.txt' in your gradle file. The getDefaultProguardFile(...) call references a different default proguard file, one provided by Google and not that in your project. So remove this as well, so that here the gradle file reads:

    buildTypes {
        release {
            runProguard true
            proguardFile 'proguard-android.txt'
        }
    }
    

提交回复
热议问题