混淆APK时出错

时间:2015-10-06 12:26:20

标签: android apk proguard obfuscation

我尝试使用debug中的proguardAndroid Studio模式对APK进行模糊处理。但是我收到了以下错误,

:ModuleName:shrinkDebugMultiDexComponents FAILED
Error:Execution failed for task ':ModuleName:shrinkDebugMultiDexComponents'.
> java.io.IOException: The output jar [E:\Repository\ApplicationName\ModuleName\build\intermediates\multi-dex\debug\componentClasses.jar] must be specified after an input jar, or it will be empty.

我的build.gradle文件,

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    signingConfigs {
        debug {
            storeFile file("./debugkeystore/AppDebug.keystore")
        }
    }
    defaultConfig {
        applicationId "com.example.packagename"
        minSdkVersion 14
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
        setMultiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    dexOptions {
        javaMaxHeapSize "2048M"
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:design:22.2.1'
    compile 'com.android.support:multidex:1.0.0'
    compile 'com.android.support:appcompat-v7:22.2.1'
    compile 'com.google.android.gms:play-services:7.5.0'
    compile 'com.android.support:recyclerview-v7:22.2.1'
    compile 'com.android.support:cardview-v7:22.2.1'
}

我的proguard-rules.pro文件,(我没有编辑此文件)

# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in F:\Softwares\Android SDK/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 *;
#}

我尝试删除build文件夹并重新编译,但以相同的错误结束。

欢迎任何关于我做错事的帮助。

0 个答案:

没有答案
相关问题