Proguard模糊处理没有';不适用于Android应用程序

Proguard模糊处理没有';不适用于Android应用程序,android,proguard,Android,Proguard,对于我的示例应用程序,这是我的build.gradle { apply plugin: 'com.android.application' android { compileSdkVersion 25 buildToolsVersion "25.0.0" defaultConfig { applicationId "com.example.credila.testndk" minSdkVersion 15 targetSd

对于我的示例应用程序,这是我的build.gradle

{
apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.0"
    defaultConfig {
        applicationId "com.example.credila.testndk"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        externalNativeBuild {
            cmake {
                cppFlags "-frtti"
            }
        }
    }
    buildTypes {
        release {
            debuggable false
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    externalNativeBuild {
        cmake {
            path "CMakeLists.txt"
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.1.0'
    testCompile 'junit:junit:4.12'
}
}
但是,我不知道为什么我的代码没有被混淆。这意味着在反编译了所有
类的
变量的
,常量的名称仍然和我给它们的名称一样,但我不想要它。请帮帮我

但是,我不知道为什么我的代码没有被混淆

Proguard仅适用于发布版本。它不会用于调试构建,因此请确保查看正确的APK

编辑

你的梯度包含

proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
虽然
proguard rules.pro
可能为空,但“proguard android.txt”(在
\tools\proguard
文件夹中)中有一些默认规则会影响您的项目。某些类不能被混淆,因为它们需要被框架访问(即
android.view.view
android.app.Activity
)的子类。必须这样做,因为如果重命名后,Android framework将无法找到正确的调用方法,并且无法确定它现在的名称为“a()”(如果这是存储在应用程序中的信息,那么整个混淆将毫无意义)


检查默认值,如果需要对某些成员进行模糊处理,请将其移动到单独的类或重新构造代码

是否确定要生成发布配置?proguard rules.pro中有什么内容?@VladMatvienko,是的,我正在使用buildconfiguration@AmrutBidri没有,然后你应该向iti添加所需的proguard规则,我用release build.it对其进行了测试hink proguard不适用于activity。添加其他类时,它会被成功地混淆。