0

私のbuild.gradleには. . .

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

私が見つけることができるすべての proguard-android.txt ファイル (C:\Users\Gary\AppData\Local\Android\sdk\tools\proguard にあるファイルなど) には、次のものが含まれています。

# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /tools/android-sdk-macosx/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}

私が見つけることができるASプロジェクトにはproject.propertiesファイルがないため、これはナンセンスに思えます。.apk で変更されていることがわかるのは、ローカル名だけです。プロガードのパラメーターはどこに置くのですか? ありがとう、ディーン

4

2 に答える 2

0

proguard-rules.txtを下にapp/(つまり と同じレベルに)配置する必要がありapp/build.gradleます。デフォルトの proguard ファイルの先頭にあるテキストはコメントです (各行の最初の文字が であることを確認してください#)。コメントの下にカスタム ルールを追加したり、コメントをまとめて削除したりできます。

デフォルトのプロガード ファイルの上部にあるコメント テキストに記載されているように、詳細なドキュメントはこちらにあります

于 2015-06-16T23:05:17.430 に答える